class documentation

class ChunkedBytesIO:

Constructor: ChunkedBytesIO(contents)

View In Hierarchy

Turn a list of bytestrings into a file-like object.

This is similar to creating a BytesIO from a concatenation of the bytestring list, but saves memory by NOT creating one giant bytestring first:

BytesIO(b''.join(list_of_bytestrings)) =~= ChunkedBytesIO(
    list_of_bytestrings)
Method __init__ Initialize ChunkedBytesIO.
Method read Read bytes from the chunked stream.
Instance Variable contents Undocumented
Instance Variable pos Undocumented
def __init__(self, contents: list[bytes]):

Initialize ChunkedBytesIO.

Parameters
contents:list[bytes]List of byte chunks
def read(self, maxbytes: int | None = None) -> bytes:

Read bytes from the chunked stream.

Parameters
maxbytes:int | NoneMaximum number of bytes to read (None for all)
Returns
bytesBytes read
contents =

Undocumented

pos =

Undocumented