def read(self, length=0, timeout_ms=None):
    """Reads data from the remote end of this stream.

    Internally, this data will have been contained in AdbMessages, but
    users of streams shouldn't need to care about the transport mechanism.

    Args:
      length: If provided, the number of bytes to read, otherwise all available
        data will be returned (at least one byte).
      timeout_ms: Time to wait for a message to come in for this stream, in
        milliseconds (or as a PolledTimeout object).

    Returns:
      Data that was read, or None if the end of the stream was reached.

    Raises:
      AdbProtocolError: Received an unexpected wonky non-stream packet (like a
        CNXN ADB message).
      AdbStreamClosedError: The stream is already closed.
      AdbTimeoutError: Timed out waiting for a message.
    """
    return self._transport.read(
        length, timeouts.PolledTimeout.from_millis(timeout_ms))
Reads data from the remote end of this stream.

    Internally, this data will have been contained in AdbMessages, but
    users of streams shouldn't need to care about the transport mechanism.

    Args:
      length: If provided, the number of bytes to read, otherwise all available
        data will be returned (at least one byte).
      timeout_ms: Time to wait for a message to come in for this stream, in
        milliseconds (or as a PolledTimeout object).

    Returns:
      Data that was read, or None if the end of the stream was reached.

    Raises:
      AdbProtocolError: Received an unexpected wonky non-stream packet (like a
        CNXN ADB message).
      AdbStreamClosedError: The stream is already closed.
      AdbTimeoutError: Timed out waiting for a message.