beatmup.ChunkCollection

class beatmup.ChunkCollection

A key-value pair set storing pieces of arbitrary data (chunks) under string keys. A chunk is a header and a piece of data packed in memory like this: (idLength[4], id[idLength], size[sizeof(chunksize_t)], data[size]) ChunkCollection defines an interface to retrieve chunks by their ids.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

chunk_exists(self, id)

Check if a specific chunk exists.

chunk_size(self, id)

Retrieves size of a specific chunk.

close(self)

Closes the collection after a reading session.

open(self)

Opens the collection to read chunks from it.

size(self)

Returns the number of chunks available in the collection after it is opened.