Modify NetStream to read n bytes

This commit is contained in:
mhchia
2019-08-07 15:23:20 +08:00
committed by Kevin Mai-Husan Chia
parent dbdbcf7440
commit 2485a00e24
4 changed files with 34 additions and 8 deletions

View File

@ -22,9 +22,10 @@ class INetStream(ABC):
"""
@abstractmethod
async def read(self) -> bytes:
async def read(self, n: int = -1) -> bytes:
"""
reads from the underlying muxed_stream
:param n: number of bytes to read
:return: bytes of input
"""