ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer Class Reference

This class is general purpose class for writing data to a buffer. More...

Inheritance diagram for ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer:

ICSharpCode::SharpZipLib::Zip::Compression::DeflaterPending List of all members.

Public Member Functions

 PendingBuffer ()
 construct instance using default buffer size of 4096
 PendingBuffer (int bufsize)
 construct instance using specified buffer size
void Reset ()
 Clear internal state/buffers.
void WriteByte (int b)
 write a byte to buffer
void WriteShort (int s)
 Write a short value to buffer LSB first.
void WriteInt (int s)
 write an integer LSB first
void WriteBlock (byte[] block, int offset, int len)
 Write a block of data to buffer.
void AlignToByte ()
 Align internal buffer on a byte boundary.
void WriteBits (int b, int count)
 Write bits to internal buffer.
void WriteShortMSB (int s)
 Write a short value to internal buffer most significant byte first.
int Flush (byte[] output, int offset, int length)
 Flushes the pending buffer into the given output array. If the output array is to small, only a partial flush is done.
byte[] ToByteArray ()
 Convert internal buffer to byte array. Buffer is empty on completion.

Protected Attributes

byte[] buf
 Internal work buffer.

Properties

int BitCount
 The number of bits written to the buffer.
bool IsFlushed
 Indicates if buffer has been flushed.

Private Attributes

int start
int end
uint bits
int bitCount

Detailed Description

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

Definition at line 53 of file PendingBuffer.cs.


Constructor & Destructor Documentation

ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::PendingBuffer  )  [inline]
 

construct instance using default buffer size of 4096

Definition at line 68 of file PendingBuffer.cs.

ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::PendingBuffer int  bufsize  )  [inline]
 

construct instance using specified buffer size

Parameters:
bufsize size to use for internal buffer

Definition at line 79 of file PendingBuffer.cs.


Member Function Documentation

void ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::AlignToByte  )  [inline]
 

Align internal buffer on a byte boundary.

Definition at line 163 of file PendingBuffer.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::Flush byte[]  output,
int  offset,
int  length
[inline]
 

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

Parameters:
output the output array;
offset the offset into output array;
length length the maximum number of bytes to store;
IndexOutOfBoundsException if offset or length are invalid.

Definition at line 239 of file PendingBuffer.cs.

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

Clear internal state/buffers.

Definition at line 87 of file PendingBuffer.cs.

byte [] ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::ToByteArray  )  [inline]
 

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

Returns:
converted buffer contents contents

Definition at line 265 of file PendingBuffer.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::WriteBits int  b,
int  count
[inline]
 

Write bits to internal buffer.

Parameters:
b source of bits
count number of bits to write

Definition at line 183 of file PendingBuffer.cs.

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

void ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::WriteBlock byte[]  block,
int  offset,
int  len
[inline]
 

Write a block of data to buffer.

Parameters:
block data to write
offset offset of first byte to write
len number of bytes to write

Definition at line 142 of file PendingBuffer.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::WriteByte int  b  )  [inline]
 

write a byte to buffer

Parameters:
b value to write

Definition at line 98 of file PendingBuffer.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::WriteInt int  s  )  [inline]
 

write an integer LSB first

Parameters:
s value to write

Definition at line 125 of file PendingBuffer.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::WriteShort int  s  )  [inline]
 

Write a short value to buffer LSB first.

Parameters:
s value to write

Definition at line 112 of file PendingBuffer.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::WriteShortMSB int  s  )  [inline]
 

Write a short value to internal buffer most significant byte first.

Parameters:
s value to write

Definition at line 205 of file PendingBuffer.cs.


Member Data Documentation

int ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::bitCount [private]
 

Definition at line 63 of file PendingBuffer.cs.

uint ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::bits [private]
 

Definition at line 62 of file PendingBuffer.cs.

byte [] ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::buf [protected]
 

Internal work buffer.

Definition at line 57 of file PendingBuffer.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::end [private]
 

Definition at line 60 of file PendingBuffer.cs.

int ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::start [private]
 

Definition at line 59 of file PendingBuffer.cs.


Property Documentation

int ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::BitCount [get]
 

The number of bits written to the buffer.

Definition at line 154 of file PendingBuffer.cs.

bool ICSharpCode::SharpZipLib::Zip::Compression::PendingBuffer::IsFlushed [get]
 

Indicates if buffer has been flushed.

Definition at line 217 of file PendingBuffer.cs.


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