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