helpers
helpers
¶
StreamReader
¶
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.
Source code in src/docx/image/helpers.py
read
¶
read_byte
¶
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.
Source code in src/docx/image/helpers.py
read_long
¶
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.
Source code in src/docx/image/helpers.py
read_short
¶
Return the int value of the two bytes at the file position determined by
base and offset, similarly to read_long() above.
Source code in src/docx/image/helpers.py
read_str
¶
Return a string containing the char_count bytes at the file position
determined by self._base_offset + base + offset.