BoundaryIter
A Producer that is sensitive to boundaries.
Attributes
| Attribute | Type | Description |
|---|---|---|
| _stream | stream object | The source data stream from which bytes are read and to which post-boundary data is pushed back. |
| _boundary | bytes | The byte sequence used to identify the end of the current data encapsulation. |
| _done | boolean = False | A boolean flag indicating whether the boundary has been reached and the iterator should stop yielding data. |
| _rollback | integer | The 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
| Name | Type | Description |
|---|---|---|
| stream | Any | The input stream to read bytes from. |
| boundary | bytes | The byte sequence that defines the boundary between parts. |