/** * Create a {@link CompressionOutputStream} that will write to the given * {@link OutputStream} with the given {@link Compressor}. * * @param out the location for the final output stream * @param compressor compressor to use * @return a stream the user can write uncompressed data to, to have it * compressed * @throws IOException */ @Override public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new CompressorStream(out, compressor, conf.getInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT)) : new BZip2CompressionOutputStream(out); }
/** * Create a {@link CompressionOutputStream} that will write to the given * {@link OutputStream} with the given {@link Compressor}. * * @param out the location for the final output stream * @param compressor compressor to use * @return a stream the user can write uncompressed data to, to have it * compressed * @throws IOException */ @Override public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new CompressorStream(out, compressor, conf.getInt(IO_FILE_BUFFER_SIZE_KEY, IO_FILE_BUFFER_SIZE_DEFAULT)) : new BZip2CompressionOutputStream(out); }
/** * Create a {@link CompressionOutputStream} that will write to the given * {@link OutputStream} with the given {@link Compressor}. * * @param out the location for the final output stream * @param compressor compressor to use * @return a stream the user can write uncompressed data to, to have it * compressed * @throws IOException */ @Override public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new CompressorStream(out, compressor, conf.getInt("io.file.buffer.size", 4*1024)) : new BZip2CompressionOutputStream(out); }
/** * Create a {@link CompressionOutputStream} that will write to the given * {@link OutputStream} with the given {@link Compressor}. * * @param out the location for the final output stream * @param compressor compressor to use * @return a stream the user can write uncompressed data to, to have it * compressed * @throws IOException */ @Override public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new CompressorStream(out, compressor, conf.getInt("io.file.buffer.size", 4*1024)) : new BZip2CompressionOutputStream(out); }
/** * Create a {@link CompressionOutputStream} that will write to the given * {@link OutputStream} with the given {@link Compressor}. * * @param out the location for the final output stream * @param compressor compressor to use * @return a stream the user can write uncompressed data to, to have it * compressed * @throws IOException */ @Override public CompressionOutputStream createOutputStream(OutputStream out, Compressor compressor) throws IOException { return Bzip2Factory.isNativeBzip2Loaded(conf) ? new CompressorStream(out, compressor, conf.getInt("io.file.buffer.size", 4*1024)) : new BZip2CompressionOutputStream(out); }
/** * Creates CompressionOutputStream for BZip2 * * @param out * The output Stream * @return The BZip2 CompressionOutputStream * @throws java.io.IOException * Throws IO exception */ public CompressionOutputStream createOutputStream(OutputStream out) throws IOException { return new BZip2CompressionOutputStream(out); }
/** * Creates CompressionOutputStream for BZip2 * * @param out * The output Stream * @return The BZip2 CompressionOutputStream * @throws java.io.IOException * Throws IO exception */ public CompressionOutputStream createOutputStream(OutputStream out) throws IOException { return new BZip2CompressionOutputStream(out); }
public void finish() throws IOException { if (needsReset) { // In the case that nothing is written to this stream, we still need to // write out the header before closing, otherwise the stream won't be // recognized by BZip2CompressionInputStream. internalReset(); } this.output.finish(); needsReset = true; }
public void close() throws IOException { if (needsReset) { // In the case that nothing is written to this stream, we still need to // write out the header before closing, otherwise the stream won't be // recognized by BZip2CompressionInputStream. internalReset(); } this.output.flush(); this.output.close(); needsReset = true; }
public void finish() throws IOException { if (needsReset) { // In the case that nothing is written to this stream, we still need to // write out the header before closing, otherwise the stream won't be // recognized by BZip2CompressionInputStream. internalReset(); } this.output.finish(); needsReset = true; }
public void finish() throws IOException { if (needsReset) { // In the case that nothing is written to this stream, we still need to // write out the header before closing, otherwise the stream won't be // recognized by BZip2CompressionInputStream. internalReset(); } this.output.finish(); needsReset = true; }
public void write(byte[] b, int off, int len) throws IOException { if (needsReset) { internalReset(); } this.output.write(b, off, len); }
public void write(int b) throws IOException { if (needsReset) { internalReset(); } this.output.write(b); }
public void finish() throws IOException { if (needsReset) { // In the case that nothing is written to this stream, we still need to // write out the header before closing, otherwise the stream won't be // recognized by BZip2CompressionInputStream. internalReset(); } this.output.finish(); needsReset = true; }
private void internalReset() throws IOException { if (needsReset) { needsReset = false; writeStreamHeader(); this.output = new CBZip2OutputStream(out); } }
public void write(byte[] b, int off, int len) throws IOException { if (needsReset) { internalReset(); } this.output.write(b, off, len); }
public void write(byte[] b, int off, int len) throws IOException { if (needsReset) { internalReset(); } this.output.write(b, off, len); }
public void write(byte[] b, int off, int len) throws IOException { if (needsReset) { internalReset(); } this.output.write(b, off, len); }
private void internalReset() throws IOException { if (needsReset) { needsReset = false; writeStreamHeader(); this.output = new CBZip2OutputStream(out); } }
public void write(int b) throws IOException { if (needsReset) { internalReset(); } this.output.write(b); }