beatmup.ChunkFile¶
- class beatmup.ChunkFile¶
File containing chunks. The file is not loaded in memory, but is scanned when first opened to collect the information about available chunks.
- __init__(self: beatmup.ChunkFile, filename: str, open_now: bool = True) None ¶
Creates a chunkfile accessor. The file content is not read until open() is called.
- Parameters:
filename – the file name / path
open_now – if true, the file is read right away. Otherwise it is done on open() call. No information is available about chunks in the file until it is opened.
Methods
__init__
(self, filename[, open_now])Creates a chunkfile accessor.
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.