C# Class Microsoft.Protocols.TestTools.StackSdk.Compression.Mppc.Compressor

Mppc Compressor, has two sliding windows size: 8k or 64k
Inheritance: IDisposable
显示文件 Open project: Microsoft/WindowsProtocolTestSuites Class Usage Examples

Public Methods

Method Description
Compress ( byte input, CompressMode &compressMode ) : byte[]

compress the input data

Compressor ( SlidingWindowSize mode ) : System

constructor with specified sliding window size

Dispose ( ) : void

release resources

Protected Methods

Method Description
Dispose ( bool disposing ) : void

release resources

Private Methods

Method Description
CompressCore ( byte input, int maxBit = 16 ) : void

Compress the input buffer and write it into output stream.

EncodeData ( uint data, int dataBitsCount ) : void

encode data of variable length

EncodeLength ( int length, int maxBit = 16 ) : void

encoding length according to RFC2118

EncodeLiteral ( byte literal ) : void

Encode literal according to RFC2118

EncodeOffset ( int offset ) : void

Encoding offset according to RFC2118

EncodeOffsetLengthPair ( OffsetLengthPair pair, int maxBit = 16 ) : void

Encode offset and length according to RFC2118

FindMatchInSlidingWindow ( byte input, int startIndex ) : OffsetLengthPair
GetHighestBitOnePos ( int data, int dataBitsCount ) : int

Get the highest position of bit one

Method Details

Compress() public method

compress the input data
public Compress ( byte input, CompressMode &compressMode ) : byte[]
input byte the input data
compressMode CompressMode the compress mode of this compress
return byte[]

Compressor() public method

constructor with specified sliding window size
public Compressor ( SlidingWindowSize mode ) : System
mode SlidingWindowSize the mode of compressor, specify the size of sliding window
return System

Dispose() public method

release resources
public Dispose ( ) : void
return void

Dispose() protected method

release resources
protected Dispose ( bool disposing ) : void
disposing bool indicate whether GC or user call this function
return void