class documentation
class DecompressingReader(object):
Constructor: DecompressingReader(f, decompressor)
A helper class that helps with reading data selectively from a compressed stream.
| Method | __init__ |
The default constructor. |
| Method | iter |
Read n bytes iteratively. |
| Method | read |
Read up to n bytes. |
| Method | read |
Read until n bytes have been read (or until EOF has been encountered). |
| Method | reseek |
Re-seek the wrapped file object to match the last read position. |
| Method | skip |
Skip the next n bytes. |
| Method | skip |
Skip bytes until the specified offset is reached. |
| Instance Variable | read |
number of compressed bytes read. |
| Instance Variable | read |
number of decompressed bytes read |
| Property | total |
Return the total size of the compressed data stream so far. |
| Instance Variable | _buffer |
Undocumented |
| Instance Variable | _decompressor |
Undocumented |
| Instance Variable | _f |
Undocumented |
The default constructor.
| Parameters | |
| f:file-like | file to read from |
| decompressor:decompressor-like | a decompressor-like object to decompress the data |
Read up to n bytes.
Similiar to file-like objects, this may return less bytes, but will return an empy string if and only if there's nothing left to read.
| Parameters | |
n:int | maximum number of bytes to read |
extraint | decompress this many bytes more, mainly used for testing |
| Returns | |
str | the bytes read |
Re-seek the wrapped file object to match the last read position.
This should be called whenever some other code may have read/seeked the underlying file object.
| Parameters | |
baseint | If specified, take this offset within the underlying file object as the actual start of this wrapper. |
Skip the next n bytes.
This will also increase DecompressingReader.read_compressed and DecompressingReader.read_decompressed.
| Parameters | |
n:int | number of bytes to skip |