Class DeflaterEngine

java.lang.Object
net.sf.jazzlib.DeflaterEngine
All Implemented Interfaces:
DeflaterConstants

class DeflaterEngine extends Object implements DeflaterConstants
  • Field Details

    • TOO_FAR

      private static final int TOO_FAR
      See Also:
    • ins_h

      private int ins_h
    • prev

      private final short[] prev
      prev[index invalid input: '&' WMASK] points to the previous index that has the same hash code as the string starting at index. This way entries with the same hash code are in a linked list. Note that the array should really be unsigned short, so you need to and the values with 0xffff.
    • matchStart

      private int matchStart
    • matchLen

      private int matchLen
    • prevAvailable

      private boolean prevAvailable
    • blockStart

      private int blockStart
    • strstart

      private int strstart
      strstart points to the current character in window.
    • lookahead

      private int lookahead
      lookahead is the number of characters starting at strstart in window that are valid. So window[strstart] until window[strstart+lookahead-1] are valid characters.
    • window

      private final byte[] window
      This array contains the part of the uncompressed stream that is of relevance. The current character is indexed by strstart.
    • strategy

      private int strategy
    • max_chain

      private int max_chain
    • max_lazy

      private int max_lazy
    • niceLength

      private int niceLength
    • goodLength

      private int goodLength
    • comprFunc

      private int comprFunc
      The current compression function.
    • inputBuf

      private byte[] inputBuf
      The input data for compression.
    • totalIn

      private int totalIn
      The total bytes of input read.
    • inputOff

      private int inputOff
      The offset into inputBuf, where input data starts.
    • inputEnd

      private int inputEnd
      The end offset of the input data.
    • pending

      private final DeflaterPending pending
    • huffman

      private final DeflaterHuffman huffman
    • adler

      private final Adler32 adler
      The adler checksum
  • Constructor Details

  • Method Details

    • reset

      public void reset()
    • resetAdler

      public final void resetAdler()
    • getAdler

      public final int getAdler()
    • getTotalIn

      public final int getTotalIn()
    • setStrategy

      public final void setStrategy(int strat)
    • setLevel

      public void setLevel(int lvl)
    • updateHash

      private final void updateHash()
    • insertString

      private final int insertString()
      Inserts the current string in the head hash and returns the previous value for this hash.
    • slideWindow

      private void slideWindow()
    • fillWindow

      private void fillWindow()
      Fill the window when the lookahead becomes insufficient. Updates strstart and lookahead. OUT assertions: strstart + lookahead invalid input: '<'= 2*WSIZE lookahead >= MIN_LOOKAHEAD or inputOff == inputEnd
    • findLongestMatch

      private boolean findLongestMatch(int curMatch)
      Find the best (longest) string in the window matching the string starting at strstart. Preconditions: strstart + MAX_MATCH invalid input: '<'= window.length.
      Parameters:
      curMatch -
    • setDictionary

      void setDictionary(byte[] buffer, int offset, int length)
    • deflateStored

      private boolean deflateStored(boolean flush, boolean finish)
    • deflateFast

      private boolean deflateFast(boolean flush, boolean finish)
    • deflateSlow

      private boolean deflateSlow(boolean flush, boolean finish)
    • deflate

      public boolean deflate(boolean flush, boolean finish)
    • setInput

      public void setInput(byte[] buf, int off, int len)
    • needsInput

      public final boolean needsInput()