Deflater and crc calculator, handling multiple types of output streams. Currently java.util.zip.ZipEntry#DEFLATED and
java.util.zip.ZipEntry#STORED are the only supported compression methods.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private final CRC32 | |
| private final Deflater | |
| private static final int | |
| private final byte[] | |
| private final byte[] | |
| private long | |
| private long | |
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. |
| pack-priv static StreamCompressor | Returns: A stream compressorThe DataOutput to receive output os, final Deflater The deflater to use for the compressor deflater)Creates a stream compressor with the given compression level. |
| public static StreamCompressor | Returns: A stream compressorThe compressionLevel, final ScatterGatherBackingStore Deflater compression levelThe ScatterGatherBackingStore to receive output bs)Creates a stream compressor with the given compression level. |
| pack-priv static StreamCompressor | Returns: A stream compressorThe stream to receive output os)Creates a stream compressor with the default compression level. |
| pack-priv static StreamCompressor | Returns: A stream compressorThe stream to receive output os, final Deflater The deflater to use deflater)Creates a stream compressor with the given compression level. |
| public static StreamCompressor | Returns: A stream compressorThe ScatterGatherBackingStore to receive output bs)Creates a stream compressor with the default compression level. |
| pack-priv static StreamCompressor | Returns: A stream compressorThe SeekableByteChannel to receive output os, final Deflater The deflater to use for the compressor deflater)Creates a stream compressor with the given compression level. |
| pack-priv void | |
| public void | deflate(final InputStream
The source to compress source, final int The #ZipArchiveEntry compression method method)Deflate the given source using the supplied compression method |
| private void | |
| pack-priv void | |
| public long | Returns: The number of bytes read, never negativeGets the number of bytes read from the source stream |
| public long | Returns: The number of bytes, never negativeThe number of bytes written to the output for the last entry |
| public long | |
| public long | Returns: The number of bytes, never negativeThe total number of bytes written to the output for all files |
| pack-priv void | |
| pack-priv long | Returns: the number of bytes written to the stream this timethe byte array to write b, final int the start position to write from offset, final int the number of bytes to write length, final int the comrpession method to use method)Writes bytes to ZIP entry. |
| public void | |
| public void | |
| private void | |
| protected abstract void |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE | |
| crc | back to summary |
|---|---|
| private final CRC32 crc | |
| def | back to summary |
|---|---|
| private final Deflater def | |
| DEFLATER_BLOCK_SIZE | back to summary |
|---|---|
| private static final int DEFLATER_BLOCK_SIZE | |
| outputBuffer | back to summary |
|---|---|
| private final byte[] outputBuffer | |
| readerBuf | back to summary |
|---|---|
| private final byte[] readerBuf | |
| sourcePayloadLength | back to summary |
|---|---|
| private long sourcePayloadLength | |
| totalWrittenToOutputStream | back to summary |
|---|---|
| private long totalWrittenToOutputStream | |
| writtenToOutputStreamForLastEntry | back to summary |
|---|---|
| private long writtenToOutputStreamForLastEntry | |
| StreamCompressor | back to summary |
|---|---|
| pack-priv StreamCompressor(final Deflater deflater) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| create | back to summary |
|---|---|
| pack-priv static StreamCompressor create(final DataOutput os, final Deflater deflater) Creates a stream compressor with the given compression level.
| |
| create | back to summary |
|---|---|
| public static StreamCompressor create(final int compressionLevel, final ScatterGatherBackingStore bs) Creates a stream compressor with the given compression level.
| |
| create | back to summary |
|---|---|
| pack-priv static StreamCompressor create(final OutputStream os) Creates a stream compressor with the default compression level.
| |
| create | back to summary |
|---|---|
| pack-priv static StreamCompressor create(final OutputStream os, final Deflater deflater) Creates a stream compressor with the given compression level.
| |
| create | back to summary |
|---|---|
| public static StreamCompressor create(final ScatterGatherBackingStore bs) Creates a stream compressor with the default compression level.
| |
| create | back to summary |
|---|---|
| pack-priv static StreamCompressor create(final SeekableByteChannel os, final Deflater deflater) Creates a stream compressor with the given compression level.
| |
| deflate | back to summary |
|---|---|
| pack-priv void deflate() throws IOException | |
| deflate | back to summary |
|---|---|
| public void deflate(final InputStream source, final int method) throws IOException Deflate the given source using the supplied compression method
| |
| deflateUntilInputIsNeeded | back to summary |
|---|---|
| private void deflateUntilInputIsNeeded() throws IOException | |
| flushDeflater | back to summary |
|---|---|
| pack-priv void flushDeflater() throws IOException | |
| getBytesRead | back to summary |
|---|---|
| public long getBytesRead() Gets the number of bytes read from the source stream
| |
| getBytesWrittenForLastEntry | back to summary |
|---|---|
| public long getBytesWrittenForLastEntry() The number of bytes written to the output for the last entry
| |
| getCrc32 | back to summary |
|---|---|
| public long getCrc32() The crc32 of the last deflated file
| |
| getTotalBytesWritten | back to summary |
|---|---|
| public long getTotalBytesWritten() The total number of bytes written to the output for all files
| |
| reset | back to summary |
|---|---|
| pack-priv void reset() | |
| write | back to summary |
|---|---|
| pack-priv long write(final byte[] b, final int offset, final int length, final int method) throws IOException Writes bytes to ZIP entry.
| |
| writeCounted | back to summary |
|---|---|
| public void writeCounted(final byte[] data) throws IOException | |
| writeCounted | back to summary |
|---|---|
| public void writeCounted(final byte[] data, final int offset, final int length) throws IOException | |
| writeDeflated | back to summary |
|---|---|
| private void writeDeflated(final byte[] b, final int offset, final int length) throws IOException | |
| writeOut | back to summary |
|---|---|
| protected abstract void writeOut(byte[] data, int offset, int length) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private final DataOutput |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | writeOut(final byte[] data, final int offset, final int length)
Implements abstract org. |
| raf | back to summary |
|---|---|
| private final DataOutput raf | |
| DataOutputCompressor | back to summary |
|---|---|
| pack-priv DataOutputCompressor(final Deflater deflater, final DataOutput raf) | |
| writeOut | back to summary |
|---|---|
| protected void writeOut(final byte[] data, final int offset, final int length) throws IOException Implements abstract org.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final OutputStream |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | writeOut(final byte[] data, final int offset, final int length)
Implements abstract org. |
| os | back to summary |
|---|---|
| private final OutputStream os | |
| OutputStreamCompressor | back to summary |
|---|---|
| pack-priv OutputStreamCompressor(final Deflater deflater, final OutputStream os) | |
| writeOut | back to summary |
|---|---|
| protected void writeOut(final byte[] data, final int offset, final int length) throws IOException Implements abstract org.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ScatterGatherBackingStore |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | writeOut(final byte[] data, final int offset, final int length)
Implements abstract org. |
| bs | back to summary |
|---|---|
| private final ScatterGatherBackingStore bs | |
| ScatterGatherBackingStoreCompressor | back to summary |
|---|---|
| pack-priv ScatterGatherBackingStoreCompressor(final Deflater deflater, final ScatterGatherBackingStore bs) | |
| writeOut | back to summary |
|---|---|
| protected void writeOut(final byte[] data, final int offset, final int length) throws IOException Implements abstract org.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final SeekableByteChannel |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| protected void | writeOut(final byte[] data, final int offset, final int length)
Implements abstract org. |
| channel | back to summary |
|---|---|
| private final SeekableByteChannel channel | |
| SeekableByteChannelCompressor | back to summary |
|---|---|
| pack-priv SeekableByteChannelCompressor(final Deflater deflater, final SeekableByteChannel channel) | |
| writeOut | back to summary |
|---|---|
| protected void writeOut(final byte[] data, final int offset, final int length) throws IOException Implements abstract org.
| |