PyDocs

Nav

Networking and Interprocess Communication

StreamReader.read

asyncio

async method of StreamReader (source) not WASI
  • StreamReader.read(n=-1)
Read up to `n` bytes from the stream.

If `n` is not provided or set to -1,
read until EOF, then return all read bytes.
If EOF was received and the internal buffer is empty,
return an empty bytes object.

If `n` is 0, return an empty bytes object immediately.

If `n` is positive, return at most `n` available bytes
as soon as at least 1 byte is available in the internal buffer.
If EOF is received before any byte is read, return an empty
bytes object.

Returned value is not limited with limit, configured at stream
creation.

If stream was paused, this function will automatically resume it if
needed.
0 Examples
No examples for asyncio/StreamReader.read.
See Also
No see-alsos for asyncio/StreamReader.read
0 Notes
No notes for StreamReader.read