Fingerprint_Card

Loading...
Searching...
No Matches
ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream Class Reference

An output stream that compresses into the BZip2 format including file header chars into another stream. More...

Inheritance diagram for ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream:
[legend]
Collaboration diagram for ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream:
[legend]

## Classes
struct | StackElement

## Public Member Functions
| BZip2OutputStream (Stream stream)
| Construct a default output stream with maximum block size.
| BZip2OutputStream (Stream stream, int blockSize)
| Initialise a new instance of the BZip2OutputStream for the specified stream, using the given blocksize.
override long | Seek (long offset, SeekOrigin origin)
| Sets the current position of this stream to the given value.
override void | SetLength (long value)
| Sets the length of this stream to the given value.
override int | ReadByte ()
| Read a byte from the stream advancing the position.
override int | Read (byte[] buffer, int offset, int count)
| Read a block of bytes.
override void | Write (byte[] buffer, int offset, int count)
| Write a block of bytes to the stream.
override void | WriteByte (byte value)
| Write a byte to the stream.
override void | Close ()
| End the current block and end compression. Close the stream and free any resources.
override void | Flush ()
| Flush output buffers.

## Protected Member Functions
override void | Dispose (bool disposing)
| Releases the unmanaged resources used by the BZip2OutputStream and optionally releases the managed resources.

## Properties
bool | IsStreamOwner`[get, set]`
| Get/set flag indicating ownership of underlying stream. When the flag is true Close will close the underlying stream also.
override bool | CanRead`[get]`
| Gets a value indicating whether the current stream supports reading.
override bool | CanSeek`[get]`
| Gets a value indicating whether the current stream supports seeking.
override bool | CanWrite`[get]`
| Gets a value indicating whether the current stream supports writing.
override long | Length`[get]`
| Gets the length in bytes of the stream.
override long | Position`[get, set]`
| Gets or sets the current position of this stream.
int | BytesWritten`[get]`
| Get the number of bytes written to the output.

## Private Member Functions
| ~BZip2OutputStream ()
| Ensures that resources are freed and other cleanup operations are performed when the garbage collector reclaims the BZip2OutputStream.
void | MakeMaps ()
void | WriteRun ()
| Get the number of bytes written to output.
void | Initialize ()
void | InitBlock ()
void | EndBlock ()
void | EndCompression ()
void | BsSetStream (Stream stream)
void | BsFinishedWithStream ()
void | BsW (int n, int v)
void | BsPutUChar (int c)
void | BsPutint (int u)
void | BsPutIntVS (int numBits, int c)
void | SendMTFValues ()
void | MoveToFrontCodeAndSend ()
void | SimpleSort (int lo, int hi, int d)
void | Vswap (int p1, int p2, int n)
void | QSort3 (int loSt, int hiSt, int dSt)
void | MainSort ()
void | RandomiseBlock ()
void | DoReversibleTransformation ()
bool | FullGtU (int i1, int i2)
void | AllocateCompressStructures ()
void | GenerateMTFValues ()

## Static Private Member Functions
static void | Panic ()
static void | HbMakeCodeLengths (char[] len, int[] freq, int alphaSize, int maxLen)
static void | HbAssignCodes (int[] code, char[] length, int minLen, int maxLen, int alphaSize)
static byte | Med3 (byte a, byte b, byte c)

## Private Attributes
readonly int[] | increments
bool | isStreamOwner = true
int | last
int | origPtr
int | blockSize100k
bool | blockRandomised
int | bytesOut
int | bsBuff
int | bsLive
IChecksum | mCrc = new StrangeCRC()
bool[] | inUse = new bool[256]
int | nInUse
char[] | seqToUnseq = new char[256]
char[] | unseqToSeq = new char[256]
char[] | selector = new char[BZip2Constants.MaximumSelectors]
char[] | selectorMtf = new char[BZip2Constants.MaximumSelectors]
byte[] | block
int[] | quadrant
int[] | zptr
short[] | szptr
int[] | ftab
int | nMTF
int[] | mtfFreq = new int[BZip2Constants.MaximumAlphaSize]
int | workFactor
int | workDone
int | workLimit
bool | firstAttempt
int | nBlocksRandomised
int | currentChar = -1
int | runLength
uint | blockCRC
uint | combinedCRC
int | allowableBlockSize
Stream | baseStream
bool | disposed_

## Static Private Attributes
const int | SETMASK = (1 << 21)
const int | CLEARMASK = (~SETMASK)
const int | GREATER_ICOST = 15
const int | LESSER_ICOST = 0
const int | SMALL_THRESH = 20
const int | DEPTH_THRESH = 10
const int | QSORT_STACK_SIZE = 1000

## Detailed Description

An output stream that compresses into the BZip2 format including file header chars into another stream.

## Constructor & Destructor Documentation

## ◆ BZip2OutputStream() [1/2]

ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BZip2OutputStream | ( | Stream | stream | ) |

Construct a default output stream with maximum block size.

Parameters

  stream | The stream to write BZip data onto.

## ◆ BZip2OutputStream() [2/2]

ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BZip2OutputStream | ( | Stream | stream,
|  | int | blockSize )

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

Parameters

  stream | The stream to write compressed data to.
  blockSize | The block size to use.

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

Here is the call graph for this function:

## ◆ ~BZip2OutputStream()

ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.~BZip2OutputStream | ( |  | ) |
| private

Ensures that resources are freed and other cleanup operations are performed when the garbage collector reclaims the BZip2OutputStream.

Here is the call graph for this function:

## Member Function Documentation

## ◆ AllocateCompressStructures()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.AllocateCompressStructures | ( |  | ) |
| private

Here is the caller graph for this function:

## ◆ BsFinishedWithStream()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BsFinishedWithStream | ( |  | ) |
| private

Here is the caller graph for this function:

## ◆ BsPutint()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BsPutint | ( | int | u | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ BsPutIntVS()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BsPutIntVS | ( | int | numBits,
|  | int | c )
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ BsPutUChar()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BsPutUChar | ( | int | c | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ BsSetStream()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BsSetStream | ( | Stream | stream | ) |
| private

Here is the caller graph for this function:

## ◆ BsW()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BsW | ( | int | n,
|  | int | v )
| private

Here is the caller graph for this function:

## ◆ Close()

override void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Close | ( |  | ) |

End the current block and end compression. Close the stream and free any resources.

Here is the call graph for this function:

## ◆ Dispose()

override void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Dispose | ( | bool | disposing | ) |
| protected

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

Parameters

  disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ DoReversibleTransformation()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.DoReversibleTransformation | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ EndBlock()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.EndBlock | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ EndCompression()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.EndCompression | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ Flush()

override void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Flush | ( |  | ) |

Flush output buffers.

Here is the caller graph for this function:

## ◆ FullGtU()

bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.FullGtU | ( | int | i1,
|  | int | i2 )
| private

Here is the caller graph for this function:

## ◆ GenerateMTFValues()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.GenerateMTFValues | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ HbAssignCodes()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.HbAssignCodes | ( | int[] | code,
|  | char[] | length,
|  | int | minLen,
|  | int | maxLen,
|  | int | alphaSize )
| static private

Here is the caller graph for this function:

## ◆ HbMakeCodeLengths()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.HbMakeCodeLengths | ( | char[] | len,
|  | int[] | freq,
|  | int | alphaSize,
|  | int | maxLen )
| static private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ InitBlock()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.InitBlock | ( |  | ) |
| private

Here is the caller graph for this function:

## ◆ Initialize()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Initialize | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ MainSort()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.MainSort | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ MakeMaps()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.MakeMaps | ( |  | ) |
| private

Here is the caller graph for this function:

## ◆ Med3()

byte ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Med3 | ( | byte | a,
|  | byte | b,
|  | byte | c )
| static private

Here is the caller graph for this function:

## ◆ MoveToFrontCodeAndSend()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.MoveToFrontCodeAndSend | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ Panic()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Panic | ( |  | ) |
| static private

Here is the caller graph for this function:

## ◆ QSort3()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.QSort3 | ( | int | loSt,
|  | int | hiSt,
|  | int | dSt )
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ RandomiseBlock()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.RandomiseBlock | ( |  | ) |
| private

Here is the caller graph for this function:

## ◆ Read()

override int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Read | ( | byte[] | buffer,
|  | int | offset,
|  | int | count )

Read a block of bytes.

Parameters

  buffer | The buffer to read into.
  offset | The offset in the buffer to start storing data at.
  count | The maximum number of bytes to read.

Returns
  The total number of bytes read. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached.

## ◆ ReadByte()

override int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.ReadByte | ( |  | ) |

Read a byte from the stream advancing the position.

Returns
  The byte read cast to an int; -1 if end of stream.

## ◆ Seek()

override long ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Seek | ( | long | offset,
|  | SeekOrigin | origin )

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

Parameters

  offset | The point relative to the offset from which to being seeking.
  origin | The reference point from which to begin seeking.

Returns
  The new position in the stream.

## ◆ SendMTFValues()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.SendMTFValues | ( |  | ) |
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ SetLength()

override void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.SetLength | ( | long | value | ) |

Sets the length of this stream to the given value.

Parameters

  value | The new stream length.

## ◆ SimpleSort()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.SimpleSort | ( | int | lo,
|  | int | hi,
|  | int | d )
| private

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ Vswap()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Vswap | ( | int | p1,
|  | int | p2,
|  | int | n )
| private

Here is the caller graph for this function:

## ◆ Write()

override void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Write | ( | byte[] | buffer,
|  | int | offset,
|  | int | count )

Write a block of bytes to the stream.

Parameters

  buffer | The buffer containing data to write.
  offset | The offset of the first byte to write.
  count | The number of bytes to write.

Here is the call graph for this function:

## ◆ WriteByte()

override void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.WriteByte | ( | byte | value | ) |

Write a byte to the stream.

Parameters

  value | The byte to write to the stream.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ WriteRun()

void ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.WriteRun | ( |  | ) |
| private

Get the number of bytes written to output.

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## ◆ allowableBlockSize

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.allowableBlockSize
| private

## ◆ baseStream

Stream ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.baseStream
| private

## ◆ block

byte [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.block
| private

## ◆ blockCRC

uint ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.blockCRC
| private

## ◆ blockRandomised

bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.blockRandomised
| private

## ◆ blockSize100k

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.blockSize100k
| private

## ◆ bsBuff

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.bsBuff
| private

## ◆ bsLive

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.bsLive
| private

## ◆ bytesOut

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.bytesOut
| private

## ◆ CLEARMASK

const int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.CLEARMASK = (~SETMASK)
| static private

## ◆ combinedCRC

uint ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.combinedCRC
| private

## ◆ currentChar

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.currentChar = -1
| private

## ◆ DEPTH_THRESH

const int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.DEPTH_THRESH = 10
| static private

## ◆ disposed_

bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.disposed_
| private

## ◆ firstAttempt

bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.firstAttempt
| private

## ◆ ftab

int [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.ftab
| private

## ◆ GREATER_ICOST

const int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.GREATER_ICOST = 15
| static private

## ◆ increments

readonly int [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.increments
| private

Initial value:
= new int[] {
1, 4, 13, 40, 121, 364, 1093, 3280,
9841, 29524, 88573, 265720,
797161, 2391484
}

## ◆ inUse

bool [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.inUse = new bool[256]
| private

## ◆ isStreamOwner

bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.isStreamOwner = true
| private

## ◆ last

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.last
| private

## ◆ LESSER_ICOST

const int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.LESSER_ICOST = 0
| static private

## ◆ mCrc

IChecksum ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.mCrc = new StrangeCRC()
| private

## ◆ mtfFreq

int [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.mtfFreq = new int[BZip2Constants.MaximumAlphaSize]
| private

## ◆ nBlocksRandomised

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.nBlocksRandomised
| private

## ◆ nInUse

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.nInUse
| private

## ◆ nMTF

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.nMTF
| private

## ◆ origPtr

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.origPtr
| private

## ◆ QSORT_STACK_SIZE

const int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.QSORT_STACK_SIZE = 1000
| static private

## ◆ quadrant

int [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.quadrant
| private

## ◆ runLength

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.runLength
| private

## ◆ selector

char [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.selector = new char[BZip2Constants.MaximumSelectors]
| private

## ◆ selectorMtf

char [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.selectorMtf = new char[BZip2Constants.MaximumSelectors]
| private

## ◆ seqToUnseq

char [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.seqToUnseq = new char[256]
| private

## ◆ SETMASK

const int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.SETMASK = (1 << 21)
| static private

## ◆ SMALL_THRESH

const int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.SMALL_THRESH = 20
| static private

## ◆ szptr

short [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.szptr
| private

## ◆ unseqToSeq

char [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.unseqToSeq = new char[256]
| private

## ◆ workDone

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.workDone
| private

## ◆ workFactor

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.workFactor
| private

## ◆ workLimit

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.workLimit
| private

## ◆ zptr

int [] ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.zptr
| private

## Property Documentation

## ◆ BytesWritten

int ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.BytesWritten
| get

Get the number of bytes written to the output.

## ◆ CanRead

override bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.CanRead
| get

Gets a value indicating whether the current stream supports reading.

## ◆ CanSeek

override bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.CanSeek
| get

Gets a value indicating whether the current stream supports seeking.

## ◆ CanWrite

override bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.CanWrite
| get

Gets a value indicating whether the current stream supports writing.

## ◆ IsStreamOwner

bool ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.IsStreamOwner
| get set

Get/set flag indicating ownership of underlying stream. When the flag is true Close will close the underlying stream also.

## ◆ Length

override long ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Length
| get

Gets the length in bytes of the stream.

## ◆ Position

override long ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream.Position
| get set

Gets or sets the current position of this stream.

The documentation for this class was generated from the following file:

- ICSharpCode.SharpZLib/BZip2/BZip2OutputStream.cs