OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, stream_list) |
def | read (self, count=0) |
def | seek (self, offset, whence=getattr(os, 'SEEK_SET', 0)) |
def | new (cls, stream_list) |
def | type (self) |
def | type_id (self) |
def | size (self) |
![]() | |
def | __getattr__ (self, attr) |
Static Public Attributes | |
k_max_memory_move | |
A reader which dynamically applies pack deltas to a base object, keeping the memory demands to a minimum. The size of the final object is only obtainable once all deltas have been applied, unless it is retrieved from a pack index. The uncompressed Delta has the following layout (MSB being a most significant bit encoded dynamic size): * MSB Source Size - the size of the base against which the delta was created * MSB Target Size - the size of the resulting data after the delta was applied * A list of one byte commands (cmd) which are followed by a specific protocol: * cmd & 0x80 - copy delta_data[offset:offset+size] * Followed by an encoded offset into the delta data * Followed by an encoded size of the chunk to copy * cmd & 0x7f - insert * insert cmd bytes from the delta buffer into the output stream * cmd == 0 - invalid operation ( or error in delta stream )
def __init__ | ( | self, | |
stream_list | |||
) |
Initialize this instance with a list of streams, the first stream being the delta to apply on top of all following deltas, the last stream being the base object onto which to apply the deltas
def new | ( | cls, | |
stream_list | |||
) |
Convert the given list of streams into a stream which resolves deltas when reading from it. :param stream_list: two or more stream objects, first stream is a Delta to the object that you want to resolve, followed by N additional delta streams. The list's last stream must be a non-delta stream. :return: Non-Delta OPackStream object whose stream can be used to obtain the decompressed resolved data :raise ValueError: if the stream list cannot be handled
def read | ( | self, | |
count = 0 |
|||
) |
def seek | ( | self, | |
offset, | |||
whence = getattr(os, 'SEEK_SET', 0) |
|||
) |
Allows to reset the stream to restart reading :raise ValueError: If offset and whence are not 0
def size | ( | self | ) |
:return: number of uncompressed bytes in the stream
def type | ( | self | ) |
def type_id | ( | self | ) |
|
static |