List of usage examples for org.apache.commons.compress.compressors.zstandard ZstdCompressorOutputStream ZstdCompressorOutputStream
public ZstdCompressorOutputStream(final OutputStream outStream, int level, boolean closeFrameOnFlush, boolean useChecksum) throws IOException
From source file:com.facebook.buck.step.fs.ZstdStep.java
@Override public StepExecutionResult execute(ExecutionContext context) throws IOException { try (InputStream in = filesystem.newFileInputStream(sourceFile); OutputStream out = filesystem.newFileOutputStream(outputPath); ZstdCompressorOutputStream zstdOut = new ZstdCompressorOutputStream(out, DEFAULT_COMPRESSION_LEVEL, false, true)) {/*from ww w .java2 s .co m*/ ByteStreams.copy(in, zstdOut); } finally { filesystem.deleteFileAtPath(sourceFile); } return StepExecutionResults.SUCCESS; }