- java.lang.Object
-
- swim.codec.Encoder<Encoder<?,O>,O>
-
- swim.deflate.Deflate<O>
-
-
Field Summary
Fields Modifier and Type Field Description intavail_outstatic intDEF_MEM_LEVELprotected intflushEncoder<?,O>inputstatic intMAX_WBITSbyte[]next_outintnext_out_indexstatic intOS_CODEstatic intOS_UNKNOWNlongtotal_inlongtotal_outstatic intZ_BEST_COMPRESSIONstatic intZ_BEST_SPEEDstatic intZ_BINARYstatic intZ_BLOCKstatic intZ_BUF_ERRORstatic intZ_DATA_ERRORstatic intZ_DEFAULT_COMPRESSIONstatic intZ_DEFAULT_STRATEGYstatic intZ_ERRNOstatic intZ_FILTEREDstatic intZ_FINISHstatic intZ_FIXEDstatic intZ_FULL_FLUSHstatic intZ_HUFFMAN_ONLYstatic intZ_MEM_ERRORstatic intZ_NEED_DICTstatic intZ_NO_COMPRESSIONstatic intZ_NO_FLUSHstatic intZ_NO_WRAPstatic intZ_OKstatic intZ_PARTIAL_FLUSHstatic intZ_RLEstatic intZ_STREAM_ENDstatic intZ_STREAM_ERRORstatic intZ_SYNC_FLUSHstatic intZ_TEXTstatic intZ_TREESstatic intZ_UNKNOWNstatic intZ_VERSION_ERRORstatic intZ_WRAP_GZIPstatic intZ_WRAP_ZLIB
-
Constructor Summary
Constructors Constructor Description Deflate()Deflate(int wrap)Deflate(int wrap, int level)Deflate(int wrap, int level, int windowBits)Deflate(int wrap, int level, int windowBits, int memlevel)Deflate(int wrap, int level, int windowBits, int memLevel, int strategy)Deflate(Encoder<?,O> input)Deflate(Encoder<?,O> input, int wrap)Deflate(Encoder<?,O> input, int wrap, int level)Deflate(Encoder<?,O> input, int wrap, int level, int windowBits)Deflate(Encoder<?,O> input, int wrap, int level, int windowBits, int memlevel)Deflate(Encoder<?,O> input, int wrap, int level, int windowBits, int memLevel, int strategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Deflate<O>clone()booleandeflate(int flush)protected intdeflate_fast(int flush)protected intdeflate_huff(int flush)protected intdeflate_rle(int flush)protected intdeflate_slow(int flush)protected intdeflate_stored(int flush)protected voiddeflateEnd()protected voiddeflateInit(int wrap, int level, int windowBits, int memLevel, int strategy)voiddeflateParams(int level, int strategy)voiddeflateReset()voiddeflateResetKeep()Deflate<O>feed(Encoder<?,O> input)Returns anEncoderthat represents the continuation of how to encode the giveninputobject.protected voidfill_window()Deflate<O>flush(int flush)protected voidflush_pending()Encoder<Encoder<?,O>,O>pull(OutputBuffer<?> output)Incrementally encodes as muchoutputbuffer data as possible, and returns anotherEncoderthat represents the continuation of how to write additional buffer data.protected intread_buf(byte[] buf, int start, int size)
-
-
-
Field Detail
-
flush
protected int flush
-
total_in
public long total_in
-
next_out
public byte[] next_out
-
next_out_index
public int next_out_index
-
avail_out
public int avail_out
-
total_out
public long total_out
-
Z_NO_FLUSH
public static final int Z_NO_FLUSH
- See Also:
- Constant Field Values
-
Z_PARTIAL_FLUSH
public static final int Z_PARTIAL_FLUSH
- See Also:
- Constant Field Values
-
Z_SYNC_FLUSH
public static final int Z_SYNC_FLUSH
- See Also:
- Constant Field Values
-
Z_FULL_FLUSH
public static final int Z_FULL_FLUSH
- See Also:
- Constant Field Values
-
Z_FINISH
public static final int Z_FINISH
- See Also:
- Constant Field Values
-
Z_BLOCK
public static final int Z_BLOCK
- See Also:
- Constant Field Values
-
Z_TREES
public static final int Z_TREES
- See Also:
- Constant Field Values
-
Z_OK
public static final int Z_OK
- See Also:
- Constant Field Values
-
Z_STREAM_END
public static final int Z_STREAM_END
- See Also:
- Constant Field Values
-
Z_NEED_DICT
public static final int Z_NEED_DICT
- See Also:
- Constant Field Values
-
Z_ERRNO
public static final int Z_ERRNO
- See Also:
- Constant Field Values
-
Z_STREAM_ERROR
public static final int Z_STREAM_ERROR
- See Also:
- Constant Field Values
-
Z_DATA_ERROR
public static final int Z_DATA_ERROR
- See Also:
- Constant Field Values
-
Z_MEM_ERROR
public static final int Z_MEM_ERROR
- See Also:
- Constant Field Values
-
Z_BUF_ERROR
public static final int Z_BUF_ERROR
- See Also:
- Constant Field Values
-
Z_VERSION_ERROR
public static final int Z_VERSION_ERROR
- See Also:
- Constant Field Values
-
Z_NO_WRAP
public static final int Z_NO_WRAP
- See Also:
- Constant Field Values
-
Z_WRAP_ZLIB
public static final int Z_WRAP_ZLIB
- See Also:
- Constant Field Values
-
Z_WRAP_GZIP
public static final int Z_WRAP_GZIP
- See Also:
- Constant Field Values
-
Z_NO_COMPRESSION
public static final int Z_NO_COMPRESSION
- See Also:
- Constant Field Values
-
Z_BEST_SPEED
public static final int Z_BEST_SPEED
- See Also:
- Constant Field Values
-
Z_BEST_COMPRESSION
public static final int Z_BEST_COMPRESSION
- See Also:
- Constant Field Values
-
Z_DEFAULT_COMPRESSION
public static final int Z_DEFAULT_COMPRESSION
- See Also:
- Constant Field Values
-
Z_FILTERED
public static final int Z_FILTERED
- See Also:
- Constant Field Values
-
Z_HUFFMAN_ONLY
public static final int Z_HUFFMAN_ONLY
- See Also:
- Constant Field Values
-
Z_RLE
public static final int Z_RLE
- See Also:
- Constant Field Values
-
Z_FIXED
public static final int Z_FIXED
- See Also:
- Constant Field Values
-
Z_DEFAULT_STRATEGY
public static final int Z_DEFAULT_STRATEGY
- See Also:
- Constant Field Values
-
Z_BINARY
public static final int Z_BINARY
- See Also:
- Constant Field Values
-
Z_TEXT
public static final int Z_TEXT
- See Also:
- Constant Field Values
-
Z_UNKNOWN
public static final int Z_UNKNOWN
- See Also:
- Constant Field Values
-
MAX_WBITS
public static final int MAX_WBITS
- See Also:
- Constant Field Values
-
DEF_MEM_LEVEL
public static final int DEF_MEM_LEVEL
- See Also:
- Constant Field Values
-
OS_UNKNOWN
public static final int OS_UNKNOWN
- See Also:
- Constant Field Values
-
OS_CODE
public static final int OS_CODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Deflate
public Deflate(Encoder<?,O> input, int wrap, int level, int windowBits, int memLevel, int strategy)
-
Deflate
public Deflate(int wrap, int level, int windowBits, int memLevel, int strategy)
-
Deflate
public Deflate(int wrap, int level, int windowBits, int memlevel)
-
Deflate
public Deflate(int wrap, int level, int windowBits)
-
Deflate
public Deflate(int wrap, int level)
-
Deflate
public Deflate(int wrap)
-
Deflate
public Deflate()
-
-
Method Detail
-
deflateInit
protected void deflateInit(int wrap, int level, int windowBits, int memLevel, int strategy)
-
deflateResetKeep
public void deflateResetKeep()
-
deflateReset
public void deflateReset()
-
deflateParams
public void deflateParams(int level, int strategy)
-
flush_pending
protected void flush_pending()
-
feed
public Deflate<O> feed(Encoder<?,O> input)
Description copied from class:EncoderReturns anEncoderthat represents the continuation of how to encode the giveninputobject.
-
pull
public Encoder<Encoder<?,O>,O> pull(OutputBuffer<?> output)
Description copied from class:EncoderIncrementally encodes as muchoutputbuffer data as possible, and returns anotherEncoderthat represents the continuation of how to write additional buffer data. IfisLastistrue, thenpullmust return a terminatedEncoder, i.e. anEncoderin the done state, or in the error state. The givenoutputbuffer is only guaranteed to be valid for the duration of the method call; references tooutputmust not be stored.
-
deflate
public boolean deflate(int flush)
-
deflateEnd
protected void deflateEnd()
-
read_buf
protected int read_buf(byte[] buf, int start, int size)
-
fill_window
protected void fill_window()
-
deflate_stored
protected int deflate_stored(int flush)
-
deflate_fast
protected int deflate_fast(int flush)
-
deflate_slow
protected int deflate_slow(int flush)
-
deflate_rle
protected int deflate_rle(int flush)
-
deflate_huff
protected int deflate_huff(int flush)
-
-