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
| Attribute | Type | Description |
|---|---|---|
| _stream | binary stream | The input data stream containing the multipart-encoded content to be parsed. |
| _separator | bytes | The 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
| Name | Type | Description |
|---|---|---|
| stream | Any | The input stream containing the multipart data. |
| boundary | bytes | The boundary string used to separate parts in the stream. |
Signature
def Parser(
stream: BinaryIO,
boundary: bytes
)
Parameters
| Name | Type | Description |
|---|---|---|
| stream | BinaryIO | The raw input stream containing multipart-encoded data |
| boundary | bytes | The byte sequence used to separate different parts within the multipart stream |