Skip to main content

BoundaryIter

A Producer that is sensitive to boundaries.

Attributes

AttributeTypeDescription
_streamstream objectThe source data stream from which bytes are read and to which post-boundary data is pushed back.
_boundarybytesThe byte sequence used to identify the end of the current data encapsulation.
_doneboolean = FalseA boolean flag indicating whether the boundary has been reached and the iterator should stop yielding data.
_rollbackintegerThe number of bytes to push back onto the stream to account for the boundary length and potential CRLF separators.

Constructor

Signature

def BoundaryIter(
stream: Any,
boundary: bytes
)

Parameters

NameTypeDescription
streamAnyThe input stream to read bytes from.
boundarybytesThe byte sequence that defines the boundary between parts.