C# Class ICSharpCode.SharpZipLib.Zip.Compression.PendingBuffer

This class is general purpose class for writing data to a buffer. It allows you to write bits as well as bytes Based on DeflaterPending.java author of the original java version : Jochen Hoenicke
Show file Open project: icsharpcode/SharpZipLib

Public Methods

Method Description
AlignToByte ( ) : void

Align internal buffer on a byte boundary

Flush ( byte output, int offset, int length ) : int

Flushes the pending buffer into the given output array. If the output array is to small, only a partial flush is done.

PendingBuffer ( ) : System

construct instance using default buffer size of 4096

PendingBuffer ( int bufferSize ) : System

construct instance using specified buffer size

Reset ( ) : void

Clear internal state/buffers

ToByteArray ( ) : byte[]

Convert internal buffer to byte array. Buffer is empty on completion

WriteBits ( int b, int count ) : void

Write bits to internal buffer

WriteBlock ( byte block, int offset, int length ) : void

Write a block of data to buffer

WriteByte ( int value ) : void

Write a byte to buffer

WriteInt ( int value ) : void

write an integer LSB first

WriteShort ( int value ) : void

Write a short value to buffer LSB first

WriteShortMSB ( int s ) : void

Write a short value to internal buffer most significant byte first

Method Details

AlignToByte() public method

Align internal buffer on a byte boundary
public AlignToByte ( ) : void
return void

Flush() public method

Flushes the pending buffer into the given output array. If the output array is to small, only a partial flush is done.
public Flush ( byte output, int offset, int length ) : int
output byte The output array.
offset int The offset into output array.
length int The maximum number of bytes to store.
return int

PendingBuffer() public method

construct instance using default buffer size of 4096
public PendingBuffer ( ) : System
return System

PendingBuffer() public method

construct instance using specified buffer size
public PendingBuffer ( int bufferSize ) : System
bufferSize int /// size to use for internal buffer ///
return System

Reset() public method

Clear internal state/buffers
public Reset ( ) : void
return void

ToByteArray() public method

Convert internal buffer to byte array. Buffer is empty on completion
public ToByteArray ( ) : byte[]
return byte[]

WriteBits() public method

Write bits to internal buffer
public WriteBits ( int b, int count ) : void
b int source of bits
count int number of bits to write
return void

WriteBlock() public method

Write a block of data to buffer
public WriteBlock ( byte block, int offset, int length ) : void
block byte data to write
offset int offset of first byte to write
length int number of bytes to write
return void

WriteByte() public method

Write a byte to buffer
public WriteByte ( int value ) : void
value int /// The value to write ///
return void

WriteInt() public method

write an integer LSB first
public WriteInt ( int value ) : void
value int The value to write.
return void

WriteShort() public method

Write a short value to buffer LSB first
public WriteShort ( int value ) : void
value int /// The value to write. ///
return void

WriteShortMSB() public method

Write a short value to internal buffer most significant byte first
public WriteShortMSB ( int s ) : void
s int value to write
return void