filedb.structfile module
Classes
- class whoosh.filedb.structfile.StructFile(fileobj, name=None, onclose=None)[source]
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”.
- flush()[source]
Flushes the buffer of the wrapped file. This is a no-op if the wrapped file does not have a flush method.
- read_tagint()[source]
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.
- write_string(s)[source]
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.