@@ -649,16 +649,17 @@ async def readuntil(self, separator=b'\n'):
649
649
async def read (self , n = - 1 ):
650
650
"""Read up to `n` bytes from the stream.
651
651
652
- If n is not provided, or set to -1, read until EOF and return all read
653
- bytes. If the EOF was received and the internal buffer is empty, return
654
- an empty bytes object.
652
+ If `n` is not provided or set to -1,
653
+ read until EOF, then return all read bytes.
654
+ If EOF was received and the internal buffer is empty,
655
+ return an empty bytes object.
655
656
656
- If n is zero , return empty bytes object immediately.
657
+ If `n` is 0 , return an empty bytes object immediately.
657
658
658
- If n is positive, this function try to read `n` bytes, and may return
659
- less or equal bytes than requested, but at least one byte. If EOF was
660
- received before any byte is read, this function returns empty byte
661
- object.
659
+ If `n` is positive, return at most `n` available bytes
660
+ as soon as at least 1 byte is available in the internal buffer.
661
+ If EOF is received before any byte is read, return an empty
662
+ bytes object.
662
663
663
664
Returned value is not limited with limit, configured at stream
664
665
creation.
0 commit comments