columnarDecompressWithNative function

Uint8List? columnarDecompressWithNative(
  1. Uint8List compressed,
  2. int algorithm
)

algorithm is 1 = zstd, 2 = lz4 (see Rust CompressionType).

Implementation

Uint8List? columnarDecompressWithNative(
  Uint8List compressed,
  int algorithm,
) {
  final inLen = compressed.lengthInBytes;
  if (inLen > 0x7fffffff) {
    return null;
  }
  if (inLen == 0) return null;
  final inP = malloc<ffi.Uint8>(inLen);
  inP.asTypedList(inLen).setAll(0, compressed);
  try {
    return _columnarDecompressNativeInput(inP, inLen, algorithm);
  } finally {
    malloc.free(inP);
  }
}