code: def read_file(self, file: Union[IO, asyncio.StreamWriter]=None):
          '''Read from connection to file.
  
          Args:
              file: A file object or a writer stream.
          '''
          if file:
              file_is_async = hasattr(file, 'drain')
  
          while True:
              data = yield from self._connection.read(4096)
  
              if not data:
                  break
  
              if file:
                  file.write(data)
  
                  if file_is_async:
                      yield from file.drain()
  
              self._data_event_dispatcher.notify_read(dataf read_file(self, file: Union[IO, asyncio.StreamWriter]=None):
          '''Read from connection to file.
  
          Args:
              file: A file object or a writer stream.
          '''
          if file:
              file_is_async = hasattr(file, 'drain')
  
          while True:
              data = yield from self._connection.read(4096)
  
              if not data:
                  break
  
              if file:
                  file.write(data)
  
                  if file_is_async:
                      yield from file.drain()
  
              self._data_event_dispatcher.notify_read(data)
docs: Read from connection to file.
  
          Args:
              file: A file object or a writer stream.