StreamReader
paper-docx 0.2.0 API reference
Wraps a file-like object to provide access to structured data from a binary file.
Byte-order is configurable. base_offset is added to any base value provided to
calculate actual location for reads.
StreamReader(stream, byte_order, base_offset=0)Functions
read
funcread(count)Allow pass-through read() call.
paramcountread_byte
funcread_byte(base, offset=0)Return the int value of the byte at the file position defined by
self._base_offset + base + offset.
If base is None, the byte is read from the current position in the stream.
parambaseparamoffset= 0read_long
funcread_long(base, offset=0)Return the int value of the four bytes at the file position defined by
self._base_offset + base + offset.
If base is None, the long is read from the current position in the stream. The
endian setting of this instance is used to interpret the byte layout of the
long.
parambaseparamoffset= 0read_short
funcread_short(base, offset=0)Return the int value of the two bytes at the file position determined by
base and offset, similarly to read_long() above.
parambaseparamoffset= 0read_str
funcread_str(char_count, base, offset=0)Return a string containing the char_count bytes at the file position
determined by self._base_offset + base + offset.
paramchar_countparambaseparamoffset= 0seek
funcseek(base, offset=0)parambaseparamoffset= 0tell
functell()Allow pass-through tell() call.