C# Class ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream

An output stream that compresses into the BZip2 format including file header chars into another stream.
Inheritance: Stream
Show file Open project: icsharpcode/SharpZipLib Class Usage Examples

Public Methods

Method Description
BZip2OutputStream ( Stream stream ) : System

Construct a default output stream with maximum block size

BZip2OutputStream ( Stream stream, int blockSize ) : System

Initialise a new instance of the for the specified stream, using the given blocksize.

Valid block sizes are in the range 1..9, with 1 giving the lowest compression and 9 the highest.

Flush ( ) : void

Flush output buffers

Read ( byte buffer, int offset, int count ) : int

Read a block of bytes

ReadByte ( ) : int

Read a byte from the stream advancing the position.

Seek ( long offset, SeekOrigin origin ) : long

Sets the current position of this stream to the given value.

SetLength ( long value ) : void

Sets the length of this stream to the given value.

Write ( byte buffer, int offset, int count ) : void

Write a block of bytes to the stream

WriteByte ( byte value ) : void

Write a byte to the stream.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the BZip2OutputStream and optionally releases the managed resources.

Private Methods

Method Description
AllocateCompressStructures ( ) : void
BsFinishedWithStream ( ) : void
BsPutIntVS ( int numBits, int c ) : void
BsPutUChar ( int c ) : void
BsPutint ( int u ) : void
BsSetStream ( Stream stream ) : void
BsW ( int n, int v ) : void
DoReversibleTransformation ( ) : void
EndBlock ( ) : void
EndCompression ( ) : void
FullGtU ( int i1, int i2 ) : bool
GenerateMTFValues ( ) : void
HbAssignCodes ( int code, char length, int minLen, int maxLen, int alphaSize ) : void
HbMakeCodeLengths ( char len, int freq, int alphaSize, int maxLen ) : void
InitBlock ( ) : void
Initialize ( ) : void
MainSort ( ) : void
MakeMaps ( ) : void
Med3 ( byte a, byte b, byte c ) : byte
MoveToFrontCodeAndSend ( ) : void
Panic ( ) : void
QSort3 ( int loSt, int hiSt, int dSt ) : void
RandomiseBlock ( ) : void
SendMTFValues ( ) : void
SimpleSort ( int lo, int hi, int d ) : void
Vswap ( int p1, int p2, int n ) : void
WriteRun ( ) : void

Get the number of bytes written to output.

Method Details

BZip2OutputStream() public method

Construct a default output stream with maximum block size
public BZip2OutputStream ( Stream stream ) : System
stream Stream The stream to write BZip data onto.
return System

BZip2OutputStream() public method

Initialise a new instance of the for the specified stream, using the given blocksize.
Valid block sizes are in the range 1..9, with 1 giving the lowest compression and 9 the highest.
public BZip2OutputStream ( Stream stream, int blockSize ) : System
stream Stream The stream to write compressed data to.
blockSize int The block size to use.
return System

Dispose() protected method

Releases the unmanaged resources used by the BZip2OutputStream and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

Flush() public method

Flush output buffers
public Flush ( ) : void
return void

Read() public method

Read a block of bytes
public Read ( byte buffer, int offset, int count ) : int
buffer byte The buffer to read into.
offset int The offset in the buffer to start storing data at.
count int The maximum number of bytes to read.
return int

ReadByte() public method

Read a byte from the stream advancing the position.
public ReadByte ( ) : int
return int

Seek() public method

Sets the current position of this stream to the given value.
public Seek ( long offset, SeekOrigin origin ) : long
offset long The point relative to the offset from which to being seeking.
origin SeekOrigin The reference point from which to begin seeking.
return long

SetLength() public method

Sets the length of this stream to the given value.
public SetLength ( long value ) : void
value long The new stream length.
return void

Write() public method

Write a block of bytes to the stream
public Write ( byte buffer, int offset, int count ) : void
buffer byte The buffer containing data to write.
offset int The offset of the first byte to write.
count int The number of bytes to write.
return void

WriteByte() public method

Write a byte to the stream.
public WriteByte ( byte value ) : void
value byte The byte to write to the stream.
return void