use of org.apache.commons.compress.compressors.snappy.FramedSnappyCompressorOutputStream in project druid by druid-io.
the class CompressionUtilsTest method testDecompressSnappy.
@Test
public void testDecompressSnappy() throws IOException {
final File tmpDir = temporaryFolder.newFolder("testDecompressSnappy");
final File snappyFile = new File(tmpDir, testFile.getName() + ".sz");
Assert.assertFalse(snappyFile.exists());
try (final OutputStream out = new FramedSnappyCompressorOutputStream(new FileOutputStream(snappyFile))) {
ByteStreams.copy(new FileInputStream(testFile), out);
}
try (final InputStream inputStream = CompressionUtils.decompress(new FileInputStream(snappyFile), snappyFile.getName())) {
assertGoodDataStream(inputStream);
}
}
Aggregations