Skip to main content

Parser

This class provides a mechanism for parsing multipart streams by identifying and iterating over content separated by a specific boundary. It wraps an input stream and yields parsed individual parts, managing the underlying boundary detection and header processing for each segment.

Attributes

AttributeTypeDescription
_streambinary streamThe input data stream containing the multipart-encoded content to be parsed.
_separatorbytesThe byte sequence derived from the boundary string used to identify the start and end of individual parts within the stream.

Constructor

Signature

def Parser(
stream: Any,
boundary: bytes
) - > null

Parameters

NameTypeDescription
streamAnyThe input stream containing the multipart data.
boundarybytesThe boundary string used to separate parts in the stream.

Signature

def Parser(
stream: BinaryIO,
boundary: bytes
)

Parameters

NameTypeDescription
streamBinaryIOThe raw input stream containing multipart-encoded data
boundarybytesThe byte sequence used to separate different parts within the multipart stream