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