-
- All Implemented Interfaces:
-
java.io.Closeable,java.lang.AutoCloseable
public abstract class StreamCompressor implements Closeable
-
-
Method Summary
Modifier and Type Method Description static StreamCompressorcreate(int compressionLevel, ScatterGatherBackingStore bs)Create a stream compressor with the given compression level. static StreamCompressorcreate(ScatterGatherBackingStore bs)Create a stream compressor with the default compression level. voidclose()voiddeflate(InputStream source, int method)Deflate the given source using the supplied compression method longgetBytesRead()Return the number of bytes read from the source stream longgetBytesWrittenForLastEntry()The number of bytes written to the output for the last entry longgetCrc32()The crc32 of the last deflated file longgetTotalBytesWritten()The total number of bytes written to the output for all files voidwriteCounted(Array<byte> data)voidwriteCounted(Array<byte> data, int offset, int length)-
-
Method Detail
-
create
static StreamCompressor create(int compressionLevel, ScatterGatherBackingStore bs)
Create a stream compressor with the given compression level.
- Parameters:
compressionLevel- The Deflater compression levelbs- The ScatterGatherBackingStore to receive output
-
create
static StreamCompressor create(ScatterGatherBackingStore bs)
Create a stream compressor with the default compression level.
- Parameters:
bs- The ScatterGatherBackingStore to receive output
-
close
void close()
-
deflate
void deflate(InputStream source, int method)
Deflate the given source using the supplied compression method
- Parameters:
source- The source to compressmethod- The #ZipArchiveEntry compression method
-
getBytesRead
long getBytesRead()
Return the number of bytes read from the source stream
-
getBytesWrittenForLastEntry
long getBytesWrittenForLastEntry()
The number of bytes written to the output for the last entry
-
getCrc32
long getCrc32()
The crc32 of the last deflated file
-
getTotalBytesWritten
long getTotalBytesWritten()
The total number of bytes written to the output for all files
-
writeCounted
void writeCounted(Array<byte> data)
-
writeCounted
void writeCounted(Array<byte> data, int offset, int length)
-
-
-
-