Class ExplodingInputStream

java.lang.Object
java.io.InputStream
org.apache.commons.compress.archivers.zip.ExplodingInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, InputStreamStatistics

class ExplodingInputStream extends InputStream implements InputStreamStatistics
The implode compression method was added to PKZIP 1.01 released in 1989. It was then dropped from PKZIP 2.0 released in 1993 in favor of the deflate method.

The algorithm is described in the ZIP File Format Specification.

Since:
1.7
See Also:
  • Field Details

    • in

      private final InputStream in
      The underlying stream containing the compressed data
    • bits

      private BitStream bits
      The stream of bits read from the input stream
    • dictionarySize

      private final int dictionarySize
      The size of the sliding dictionary (4K or 8K)
    • numberOfTrees

      private final int numberOfTrees
      The number of Shannon-Fano trees (2 or 3)
    • minimumMatchLength

      private final int minimumMatchLength
    • literalTree

      private BinaryTree literalTree
      The binary tree containing the 256 encoded literals (null when only two trees are used)
    • lengthTree

      private BinaryTree lengthTree
      The binary tree containing the 64 encoded lengths
    • distanceTree

      private BinaryTree distanceTree
      The binary tree containing the 64 encoded distances
    • buffer

      private final CircularBuffer buffer
      Output buffer holding the decompressed data
    • uncompressedCount

      private long uncompressedCount
    • treeSizes

      private long treeSizes
  • Constructor Details

    • ExplodingInputStream

      public ExplodingInputStream(int dictionarySize, int numberOfTrees, InputStream in)
      Create a new stream decompressing the content of the specified stream using the explode algorithm.
      Parameters:
      dictionarySize - the size of the sliding dictionary (4096 or 8192)
      numberOfTrees - the number of trees (2 or 3)
      in - the compressed data stream
  • Method Details