The RawStream handler provides low-level stream I/O functionality.
Specialisation of exception for RawStream.
RawStream premature EOF.
Class that creates a I/O stream from a file path or file-like object and provides various low level functionality on it such as unpacking.
f - A file like object or string, if the latter it assumed to be a path.
mode - The file mode, defaults to binary read.
fileId - If f is a string is this is present then this is used as the file name. If f is not a string then f.name is used with fileId as a fallback.
Construct with: f - A file like object or string, if the latter it assumed to be a path. mode - The file mode, defaults to binary read. fileId - If f is a string is this is present then this is used as the file name. If f is not a string then f.name is used with fileId as a fallback.
Context Manager support.
Context manager finalisation, this closes the underlying stream.
Exposes the underlying stream.
Return the file’s current position, like stdio’s ftell.
Set the file’s current position, like stdio’s fseek. The whence argument is optional and defaults to os.SEEK_SET or 0 (absolute file positioning); other values are os.SEEK_CUR or 1 (seek relative to the current position) and os.SEEK_END or 2 (seek relative to the file’s end). There is no return value. Not all file objects are seekable.
Reads and returns theLen bytes.
list of weak references to the object (if defined)
Writes theB bytes.
Closes the underlying stream.
Reads from the stream and unpacks binary data according to the struct module format. This returns a tuple.
theStruct - A formated instance of struct.Struct().
Packs binary data from args and writes it to the stream.
theStruct - A formated instance of struct.Struct().
args - The data to write.