@@ -627,16 +627,17 @@ async def readuntil(self, separator=b'\n'):
627
627
async def read (self , n = - 1 ):
628
628
"""Read up to `n` bytes from the stream.
629
629
630
- If n is not provided, or set to -1, read until EOF and return all read
631
- bytes. If the EOF was received and the internal buffer is empty, return
632
- an empty bytes object.
630
+ If `n` is not provided or set to -1,
631
+ read until EOF, then return all read bytes.
632
+ If EOF was received and the internal buffer is empty,
633
+ return an empty bytes object.
633
634
634
- If n is zero , return empty bytes object immediately.
635
+ If `n` is 0 , return an empty bytes object immediately.
635
636
636
- If n is positive, this function try to read `n` bytes, and may return
637
- less or equal bytes than requested, but at least one byte. If EOF was
638
- received before any byte is read, this function returns empty byte
639
- object.
637
+ If `n` is positive, return at most `n` available bytes
638
+ as soon as at least 1 byte is available in the internal buffer.
639
+ If EOF is received before any byte is read, return an empty
640
+ bytes object.
640
641
641
642
Returned value is not limited with limit, configured at stream
642
643
creation.
0 commit comments