aistore.sdk.batch.multipart.body_stream_reader

View as Markdown

Module Contents

Classes

NameDescription
BodyStreamReaderStream reader that only reads the body portion of a part from a

API

class aistore.sdk.batch.multipart.body_stream_reader.BodyStreamReader(
buffer_reader: aistore.sdk.batch.multipart.multipart_stream_buffer.MultipartStreamBuffer
)

Bases: BufferedIOBase

Stream reader that only reads the body portion of a part from a buffered multipart stream. This class extends BufferedIOBase and provides a read-only interface for consuming multipart body content until a boundary is encountered.

aistore.sdk.batch.multipart.body_stream_reader.BodyStreamReader.close() -> None

Close the reader.

aistore.sdk.batch.multipart.body_stream_reader.BodyStreamReader.read(
size: int = -1
) -> bytes

Read up to size bytes from the stream.

For multipart streams, this respects logical boundaries and may return more data than requested to maintain boundary integrity.

Parameters:

size
intDefaults to -1

Number of bytes to read. If size is omitted, None, or negative read as much as possible. Defaults to -1.

Returns: bytes

Data read from the stream.

aistore.sdk.batch.multipart.body_stream_reader.BodyStreamReader.readable() -> bool

Return True if the stream is readable.

aistore.sdk.batch.multipart.body_stream_reader.BodyStreamReader.seekable() -> bool

Return False as this stream does not support seeking.

aistore.sdk.batch.multipart.body_stream_reader.BodyStreamReader.writable() -> bool

Return False as this stream is read-only.