SChunk.get_slice#

SChunk.get_slice(start=0, stop=None, out=None)#

Get a slice from start to stop.

Parameters:
  • start (int) – The index where the slice will begin. Default is 0.

  • stop (int) – The index where the slice will end (without including it). Default is until the SChunk ends.

  • out (bytes-like object or bytearray) – The destination object (supporting the Buffer Protocol) to fill. The user must make sure that it has enough capacity for hosting the decompressed data. Default is None, meaning that a new bytes object is created, filled and returned.

Returns:

out – The decompressed slice in form of a Python str / bytes object if out is None. Otherwise, it will return None as the result will already be in out.

Return type:

str/bytes or None

Raises:
  • ValueError – If the size to get is negative. If there is not enough space in out. If start is greater or equal than the SChunk nitems

  • RunTimeError – If some problem was detected.

See also

__getitem__()