Yield data until this stream is closed.

    Args:
      timeout_ms: Timeout in milliseconds to keep reading (or a PolledTimeout
        object).

    Yields:
      Data read from a single call to self.read(), until the stream is closed
    or timeout is reached.

    Raises:
      AdbTimeoutError: On timeout.

def read_until_close(self, timeout_ms=None):
    """Yield data until this stream is closed.

    Args:
      timeout_ms: Timeout in milliseconds to keep reading (or a PolledTimeout
        object).

    Yields:
      Data read from a single call to self.read(), until the stream is closed
    or timeout is reached.

    Raises:
      AdbTimeoutError: On timeout.
    """
    while True:
      try:
        yield self.read(timeout_ms=timeout_ms)
      except usb_exceptions.AdbStreamClosedError:
        break