SChunk.append_data#

SChunk.append_data(data)#

Append a data buffer to the SChunk.

The data buffer must be of size chunksize specified in __init__() .

Parameters:

dataΒΆ (bytes-like object) – The data to be compressed and added as a chunk.

Returns:

out – The number of chunks in the SChunk.

Return type:

int

Raises:

RunTimeError – If data could not be appended.

Examples

>>> import blosc2
>>> import numpy
>>> schunk = blosc2.SChunk(chunksize=200*1000*4)
>>> data =  numpy.arange(200 * 1000, dtype='int32')
>>> schunk.append_data(data)
1