use of com.facebook.buck.util.BestCompressionGZIPOutputStream in project buck by facebook.
the class ChromeTraceBuildListener method createPathAndStream.
private TracePathAndStream createPathAndStream(InvocationInfo invocationInfo) {
String filenameTime = dateFormat.get().format(new Date(clock.currentTimeMillis()));
String traceName = String.format("build.%s.%s.trace", filenameTime, invocationInfo.getBuildId());
if (compressTraces) {
traceName = traceName + ".gz";
}
Path tracePath = invocationInfo.getLogDirectoryPath().resolve(traceName);
try {
projectFilesystem.createParentDirs(tracePath);
OutputStream stream = projectFilesystem.newFileOutputStream(tracePath);
if (compressTraces) {
stream = new BestCompressionGZIPOutputStream(stream, true);
}
return new TracePathAndStream(tracePath, stream);
} catch (IOException e) {
throw new HumanReadableException(e, "Unable to write trace file: " + e);
}
}
use of com.facebook.buck.util.BestCompressionGZIPOutputStream in project buck by facebook.
the class CompressingFileHandler method setOutputStream.
@Override
protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
OutputStream stream;
try {
stream = new BestCompressionGZIPOutputStream(out, true);
} catch (IOException e) {
throw new RuntimeException(e);
}
super.setOutputStream(stream);
}
Aggregations