Fingerprint_Card
Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman Class Reference

This is the DeflaterHuffman class. More...

Collaboration diagram for ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman:

Classes

class  Tree

Public Member Functions

 DeflaterHuffman (DeflaterPending pending)
 Construct instance with pending buffer.
void Reset ()
 Reset internal state.
void SendAllTrees (int blTreeCodes)
 Write all trees to pending buffer.
void CompressBlock ()
 Compress current buffer writing data to pending buffer.
void FlushStoredBlock (byte[] stored, int storedOffset, int storedLength, bool lastBlock)
 Flush block to output with no compression.
void FlushBlock (byte[] stored, int storedOffset, int storedLength, bool lastBlock)
 Flush block to output with compression.
bool IsFull ()
 Get value indicating if internal buffer is full.
bool TallyLit (int literal)
 Add literal to buffer.
bool TallyDist (int distance, int length)
 Add distance code and length to literal and distance trees.

Static Public Member Functions

static short BitReverse (int toReverse)
 Reverse the bits of a 16 bit value.

Public Attributes

DeflaterPending pending
 Pending buffer to use.

Static Private Member Functions

static DeflaterHuffman ()
static int Lcode (int length)
static int Dcode (int distance)

Private Attributes

Tree literalTree
Tree distTree
Tree blTree
short[] d_buf
byte[] l_buf
int last_lit
int extra_bits

Static Private Attributes

const int BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6)
const int LITERAL_NUM = 286
const int DIST_NUM = 30
const int BITLEN_NUM = 19
const int REP_3_6 = 16
const int REP_3_10 = 17
const int REP_11_138 = 18
const int EOF_SYMBOL = 256
static readonly int[] BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }
static readonly byte[] bit4Reverse
static short[] staticLCodes
static byte[] staticLLength
static short[] staticDCodes
static byte[] staticDLength

Detailed Description

This is the DeflaterHuffman class.

This class is not thread safe. This is inherent in the API, due to the split of Deflate and SetInput.

author of the original java version : Jochen Hoenicke

Constructor & Destructor Documentation

◆ DeflaterHuffman() [1/2]

ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.DeflaterHuffman ( )
staticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeflaterHuffman() [2/2]

ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.DeflaterHuffman ( DeflaterPending pending)

Construct instance with pending buffer.

Parameters
pendingPending buffer to use

Member Function Documentation

◆ BitReverse()

short ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.BitReverse ( int toReverse)
static

Reverse the bits of a 16 bit value.

Parameters
toReverseValue to reverse bits
Returns
Value with bits reversed
Here is the caller graph for this function:

◆ CompressBlock()

void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.CompressBlock ( )

Compress current buffer writing data to pending buffer.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dcode()

int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Dcode ( int distance)
staticprivate
Here is the caller graph for this function:

◆ FlushBlock()

void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.FlushBlock ( byte[] stored,
int storedOffset,
int storedLength,
bool lastBlock )

Flush block to output with compression.


Parameters
storedData to flush
storedOffsetIndex of first byte to flush
storedLengthCount of bytes to flush
lastBlockTrue if this is the last block
Here is the call graph for this function:

◆ FlushStoredBlock()

void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.FlushStoredBlock ( byte[] stored,
int storedOffset,
int storedLength,
bool lastBlock )

Flush block to output with no compression.

Parameters
storedData to write
storedOffsetIndex of first byte to write
storedLengthCount of bytes to write
lastBlockTrue if this is the last block
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsFull()

bool ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.IsFull ( )

Get value indicating if internal buffer is full.

Returns
true if buffer is full
Here is the caller graph for this function:

◆ Lcode()

int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Lcode ( int length)
staticprivate
Here is the caller graph for this function:

◆ Reset()

void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.Reset ( )

Reset internal state.

Here is the caller graph for this function:

◆ SendAllTrees()

void ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.SendAllTrees ( int blTreeCodes)

Write all trees to pending buffer.

Parameters
blTreeCodesThe number/rank of treecodes to send.
Here is the caller graph for this function:

◆ TallyDist()

bool ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.TallyDist ( int distance,
int length )

Add distance code and length to literal and distance trees.

Parameters
distanceDistance code
lengthLength
Returns
Value indicating if internal buffer is full
Here is the call graph for this function:

◆ TallyLit()

bool ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.TallyLit ( int literal)

Add literal to buffer.

Parameters
literalLiteral value to add to buffer.
Returns
Value indicating internal buffer is full
Here is the call graph for this function:

Member Data Documentation

◆ bit4Reverse

readonly byte [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.bit4Reverse
staticprivate
Initial value:
= {
0,
8,
4,
12,
2,
10,
6,
14,
1,
9,
5,
13,
3,
11,
7,
15
}

◆ BITLEN_NUM

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.BITLEN_NUM = 19
staticprivate

◆ BL_ORDER

readonly int [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.BL_ORDER = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }
staticprivate

◆ blTree

Tree ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.blTree
private

◆ BUFSIZE

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6)
staticprivate

◆ d_buf

short [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.d_buf
private

◆ DIST_NUM

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.DIST_NUM = 30
staticprivate

◆ distTree

Tree ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.distTree
private

◆ EOF_SYMBOL

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.EOF_SYMBOL = 256
staticprivate

◆ extra_bits

int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.extra_bits
private

◆ l_buf

byte [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.l_buf
private

◆ last_lit

int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.last_lit
private

◆ LITERAL_NUM

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.LITERAL_NUM = 286
staticprivate

◆ literalTree

Tree ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.literalTree
private

◆ pending

DeflaterPending ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.pending

Pending buffer to use.

◆ REP_11_138

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.REP_11_138 = 18
staticprivate

◆ REP_3_10

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.REP_3_10 = 17
staticprivate

◆ REP_3_6

const int ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.REP_3_6 = 16
staticprivate

◆ staticDCodes

short [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.staticDCodes
staticprivate

◆ staticDLength

byte [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.staticDLength
staticprivate

◆ staticLCodes

short [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.staticLCodes
staticprivate

◆ staticLLength

byte [] ICSharpCode.SharpZipLib.Zip.Compression.DeflaterHuffman.staticLLength
staticprivate

The documentation for this class was generated from the following file: