Returns a “structured file” object that wraps the given file object and provides numerous additional methods for writing structured data, such as “write_varint” and “write_long”.
Closes the wrapped file.
Flushes the buffer of the wrapped file. This is a no-op if the wrapped file does not have a flush method.
Reads a pickled object from the wrapped file.
Reads a string from the wrapped file.
Reads a variable-length encoded signed integer from the wrapped file.
Reads a sometimes-compressed unsigned integer from the wrapped file. This is similar to the varint methods but uses a less compressed but faster format.
Reads a variable-length encoded unsigned integer from the wrapped file.
Writes a single byte to the wrapped file, shortcut for file.write(chr(n)).
Writes a pickled representation of obj to the wrapped file.
Writes a string to the wrapped file. This method writes the length of the string first, so you can read the string back without having to know how long it was.
Writes a variable-length signed integer to the wrapped file.
Writes a sometimes-compressed unsigned integer to the wrapped file. This is similar to the varint methods but uses a less compressed but faster format.
Writes a variable-length unsigned integer to the wrapped file.