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