pylbo.utilities.datfiles.istream_reader
Attributes
Functions
|
|
|
Reads a string from the input stream. |
|
Reads an integer from the input stream. |
|
Reads a boolean from the input stream. |
|
Reads a float from the input stream. |
|
Reads a complex from the input stream. |
|
Reads a number of mixed types from the input stream. |
Module Contents
- pylbo.utilities.datfiles.istream_reader.read_string_from_istream(istream: BinaryIO, length: int, amount: int = 1, offset: int = None, byte_order: str = 'native') str | list[str] [source]
Reads a string from the input stream.
- Parameters:
istream (BinaryIO) – The input stream to read from.
length (int) – The length of the string to read.
amount (int, optional) – The amount of strings to read, by default 1.
offset (int, optional) – The offset to seek to before reading, by default None.
byte_order (str, optional) – The byte order to use, by default “native”.
- Returns:
The string(s) read from the input stream.
- Return type:
- pylbo.utilities.datfiles.istream_reader.read_int_from_istream(istream: BinaryIO, amount: int = 1, offset: int = None, byte_order: str = 'native') int | tuple[int, Ellipsis] [source]
Reads an integer from the input stream.
- Parameters:
- Returns:
The integer(s) read from the input stream.
- Return type:
- pylbo.utilities.datfiles.istream_reader.read_boolean_from_istream(istream: BinaryIO, offset: int = None, byte_order: str = 'native') bool [source]
Reads a boolean from the input stream.
- pylbo.utilities.datfiles.istream_reader.read_float_from_istream(istream: BinaryIO, amount: int = 1, offset: int = None, byte_order: str = 'native') float | tuple[float, Ellipsis] [source]
Reads a float from the input stream.
- Parameters:
- Returns:
The float(s) read from the input stream.
- Return type:
- pylbo.utilities.datfiles.istream_reader.read_complex_from_istream(istream: BinaryIO, amount: int = 1, offset: int = None, byte_order: str = 'native') complex | tuple[complex, Ellipsis] [source]
Reads a complex from the input stream.
- Parameters:
- Returns:
The complex number(s) read from the input stream.
- Return type:
- pylbo.utilities.datfiles.istream_reader.read_mixed_from_istream(istream: BinaryIO, fmt: str, amount: int = 1, offset: int = None, byte_order: str = 'native')[source]
Reads a number of mixed types from the input stream.
- Parameters:
istream (BinaryIO) – The input stream to read from.
fmt (str) – The format string to use.
amount (int, optional) – The amount of mixed types to read, by default 1.
offset (int, optional) – The offset to seek to before reading, by default None.
byte_order (str, optional) – The byte order to use, by default “native”.
- Returns:
The mixed types read from the input stream.
- Return type:
tuple of mixed