private ScatterZipOutputStream createDeferred(final ScatterGatherBackingStoreSupplier scatterGatherBackingStoreSupplier) throws IOException { final ScatterGatherBackingStore bs = scatterGatherBackingStoreSupplier.get(); // lifecycle is bound to the ScatterZipOutputStream returned final StreamCompressor sc = StreamCompressor.create(Deflater.DEFAULT_COMPRESSION, bs); //NOSONAR return new ScatterZipOutputStream(bs, sc); }
/** * Create a {@link ScatterZipOutputStream} that is backed by a file * * @param file The file to offload compressed data into. * @param compressionLevel The compression level to use, @see #Deflater * @return A ScatterZipOutputStream that is ready for use. * @throws FileNotFoundException if the file cannot be found */ public static ScatterZipOutputStream fileBased(final File file, final int compressionLevel) throws FileNotFoundException { final ScatterGatherBackingStore bs = new FileBasedScatterGatherBackingStore(file); // lifecycle is bound to the ScatterZipOutputStream returned final StreamCompressor sc = StreamCompressor.create(compressionLevel, bs); //NOSONAR return new ScatterZipOutputStream(bs, sc); } }
public static ScatterZipOutputStream createDeferred( ScatterGatherBackingStoreSupplier scatterGatherBackingStoreSupplier ) throws IOException { ScatterGatherBackingStore bs = scatterGatherBackingStoreSupplier.get(); StreamCompressor sc = StreamCompressor.create( Deflater.DEFAULT_COMPRESSION, bs ); return new ScatterZipOutputStream( bs, sc ); }
private ScatterZipOutputStream createDeferred(final ScatterGatherBackingStoreSupplier scatterGatherBackingStoreSupplier) throws IOException { final ScatterGatherBackingStore bs = scatterGatherBackingStoreSupplier.get(); // lifecycle is bound to the ScatterZipOutputStream returned final StreamCompressor sc = StreamCompressor.create(Deflater.DEFAULT_COMPRESSION, bs); //NOSONAR return new ScatterZipOutputStream(bs, sc); }
/** * Create a {@link ScatterZipOutputStream} that is backed by a file * * @param file The file to offload compressed data into. * @param compressionLevel The compression level to use, @see #Deflater * @return A ScatterZipOutputStream that is ready for use. * @throws FileNotFoundException if the file cannot be found */ public static ScatterZipOutputStream fileBased(final File file, final int compressionLevel) throws FileNotFoundException { final ScatterGatherBackingStore bs = new FileBasedScatterGatherBackingStore(file); // lifecycle is bound to the ScatterZipOutputStream returned final StreamCompressor sc = StreamCompressor.create(compressionLevel, bs); //NOSONAR return new ScatterZipOutputStream(bs, sc); } }