use of com.linkedin.r2.filter.compression.streaming.DeflateCompressor in project rest.li by linkedin.
the class TestStreamingCompression method testDeflateCompressor.
@Test
public void testDeflateCompressor() throws IOException, InterruptedException, CompressionException, ExecutionException {
StreamingCompressor compressor = new DeflateCompressor(_executor);
final byte[] origin = new byte[BUF_SIZE];
Arrays.fill(origin, (byte) 'c');
ByteArrayOutputStream out = new ByteArrayOutputStream();
DeflaterOutputStream zlib = new DeflaterOutputStream(out);
IOUtils.write(origin, zlib);
zlib.close();
byte[] compressed = out.toByteArray();
testCompress(compressor, origin, compressed);
testDecompress(compressor, origin, compressed);
testCompressThenDecompress(compressor, origin);
}
use of com.linkedin.r2.filter.compression.streaming.DeflateCompressor in project rest.li by linkedin.
the class TestStreamingCompression method testDeflateCompressor.
@Test
public void testDeflateCompressor() throws IOException, InterruptedException, CompressionException, ExecutionException {
StreamingCompressor compressor = new DeflateCompressor(_executor);
final byte[] origin = new byte[BUF_SIZE];
Arrays.fill(origin, (byte) 'c');
ByteArrayOutputStream out = new ByteArrayOutputStream();
DeflaterOutputStream zlib = new DeflaterOutputStream(out);
IOUtils.write(origin, zlib);
zlib.close();
byte[] compressed = out.toByteArray();
testCompress(compressor, origin, compressed);
testDecompress(compressor, origin, compressed);
testCompressThenDecompress(compressor, origin);
}
Aggregations