use of io.airlift.compress.zstd.ZstdCompressor in project presto by prestodb.
the class TestParquetCompressionUtils method performTest.
private void performTest(CompressionCodecName codec, int inputLength) throws IOException {
Compressor compressor = null;
if (codec.equals(ZSTD)) {
compressor = new ZstdCompressor();
} else if (codec.equals(LZ4)) {
compressor = new Lz4Compressor();
}
byte[] input = createArray(inputLength);
byte[] output = new byte[inputLength + 512];
int retLength = compress(compressor, input, inputLength, output, 0);
Slice decompressedSlice = ParquetCompressionUtils.decompress(codec, wrappedBuffer(output, 0, retLength), inputLength);
assertEquals(decompressedSlice, wrappedBuffer(input));
}
Aggregations