ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman Class Reference

This is the DeflaterHuffman class. More...

List of all members.

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 lit)
 Add literal to buffer.
bool TallyDist (int dist, int len)
 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.

Private Member Functions

int Lcode (int len)
int Dcode (int distance)

Static Private Member Functions

static DeflaterHuffman ()

Private Attributes

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

Static Private Attributes

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

Classes

class  Tree
 Not documented. More...


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

Definition at line 53 of file DeflaterHuffman.cs.


Constructor & Destructor Documentation

static ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::DeflaterHuffman  )  [inline, static, private]
 

Definition at line 587 of file DeflaterHuffman.cs.

ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::DeflaterHuffman DeflaterPending  pending  )  [inline]
 

Construct instance with pending buffer.

Parameters:
pending Pending buffer to use

Definition at line 624 of file DeflaterHuffman.cs.


Member Function Documentation

static short ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::BitReverse int  toReverse  )  [inline, static]
 

Reverse the bits of a 16 bit value.

Parameters:
toReverse Value to reverse bits
Returns:
Value with bits reversed

Definition at line 578 of file DeflaterHuffman.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::CompressBlock  )  [inline]
 

Compress current buffer writing data to pending buffer.

Definition at line 696 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::Dcode int  distance  )  [inline, private]
 

Definition at line 662 of file DeflaterHuffman.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::FlushBlock byte[]  stored,
int  storedOffset,
int  storedLength,
bool  lastBlock
[inline]
 

Flush block to output with compression.

Parameters:
stored Data to flush
storedOffset Index of first byte to flush
storedLength Count of bytes to flush
lastBlock True if this is the last block

Definition at line 769 of file DeflaterHuffman.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::FlushStoredBlock byte[]  stored,
int  storedOffset,
int  storedLength,
bool  lastBlock
[inline]
 

Flush block to output with no compression.

Parameters:
stored Data to write
storedOffset Index of first byte to write
storedLength Count of bytes to write
lastBlock True if this is the last block

Definition at line 749 of file DeflaterHuffman.cs.

bool ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::IsFull  )  [inline]
 

Get value indicating if internal buffer is full.

Returns:
true if buffer is full

Definition at line 833 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::Lcode int  len  )  [inline, private]
 

Definition at line 648 of file DeflaterHuffman.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::Reset  )  [inline]
 

Reset internal state.

Definition at line 639 of file DeflaterHuffman.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::SendAllTrees int  blTreeCodes  )  [inline]
 

Write all trees to pending buffer.

Definition at line 675 of file DeflaterHuffman.cs.

bool ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::TallyDist int  dist,
int  len
[inline]
 

Add distance code and length to literal and distance trees.

Parameters:
dist Distance code
len Length
Returns:
Value indicating if internal buffer is full

Definition at line 864 of file DeflaterHuffman.cs.

bool ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::TallyLit int  lit  )  [inline]
 

Add literal to buffer.

Parameters:
lit 
Returns:
Value indicating internal buffer is full

Definition at line 843 of file DeflaterHuffman.cs.


Member Data Documentation

byte [] ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::bit4Reverse [static, private]
 

Initial value:

 {
                        0,
                        8,
                        4,
                        12,
                        2,
                        10,
                        6,
                        14,
                        1,
                        9,
                        5,
                        13,
                        3,
                        11,
                        7,
                        15
                }

Definition at line 65 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::BITLEN_NUM = 19 [static, private]
 

Definition at line 58 of file DeflaterHuffman.cs.

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 } [static, private]
 

Definition at line 63 of file DeflaterHuffman.cs.

Tree ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::blTree [private]
 

Definition at line 561 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::BUFSIZE = 1 << (DeflaterConstants.DEFAULT_MEM_LEVEL + 6) [static, private]
 

Definition at line 55 of file DeflaterHuffman.cs.

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

Definition at line 563 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::DIST_NUM = 30 [static, private]
 

Definition at line 57 of file DeflaterHuffman.cs.

Tree ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::distTree [private]
 

Definition at line 561 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::EOF_SYMBOL = 256 [static, private]
 

Definition at line 62 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::extra_bits [private]
 

Definition at line 566 of file DeflaterHuffman.cs.

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

Definition at line 564 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::last_lit [private]
 

Definition at line 565 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::LITERAL_NUM = 286 [static, private]
 

Definition at line 56 of file DeflaterHuffman.cs.

Tree ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::literalTree [private]
 

Definition at line 561 of file DeflaterHuffman.cs.

DeflaterPending ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::pending
 

Pending buffer to use.

Definition at line 559 of file DeflaterHuffman.cs.

Referenced by ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::Tree::WriteSymbol().

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::REP_11_138 = 18 [static, private]
 

Definition at line 61 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::REP_3_10 = 17 [static, private]
 

Definition at line 60 of file DeflaterHuffman.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::REP_3_6 = 16 [static, private]
 

Definition at line 59 of file DeflaterHuffman.cs.

short [] ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::staticDCodes [static, private]
 

Definition at line 570 of file DeflaterHuffman.cs.

byte [] ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::staticDLength [static, private]
 

Definition at line 571 of file DeflaterHuffman.cs.

short [] ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::staticLCodes [static, private]
 

Definition at line 568 of file DeflaterHuffman.cs.

byte [] ICSharpCode::SharpZipLib::Zip::Compression::DeflaterHuffman::staticLLength [static, private]
 

Definition at line 569 of file DeflaterHuffman.cs.


The documentation for this class was generated from the following file:
Generated on Fri Jun 23 21:50:07 2006 for OblivionModTranslator by  doxygen 1.4.6-NO