Skip to main content

unpack_from

Unpacks data from a BytesIO buffer according to the specified format string by retrieving the buffer's entire content.

def unpack_from(
fmt: string,
iobuf: BytesIO,
unpack: callable
) - > tuple

Unpacks binary data from a BytesIO buffer according to the specified format string.

Parameters

NameTypeDescription
fmtstringThe format string defining the layout of the binary data and the desired Python types.
iobufBytesIOThe BytesIO stream containing the binary data to be unpacked.
unpackcallableThe underlying unpack function used to process the buffer's contents, defaulting to the standard struct.unpack.

Returns

TypeDescription
tupleA tuple containing the unpacked values as defined by the format string.