ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream Class Reference

A special stream deflating or compressing the bytes that are written to it. It uses a Deflater to perform actual deflating.
Authors of the original java version : Tom Tromey, Jochen Hoenicke. More...

Inheritance diagram for ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream:

ICSharpCode::SharpZipLib::Zip::ZipOutputStream List of all members.

Public Member Functions

override long Seek (long offset, SeekOrigin origin)
 Sets the current position of this stream to the given value. Not supported by this class!
override void SetLength (long val)
 Sets the length of this stream to the given value. Not supported by this class!
override int ReadByte ()
 Read a byte from stream advancing position by one.
override int Read (byte[] b, int off, int len)
 Read a block of bytes from stream.
override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 Asynchronous reads are not supported a NotSupportedException is always thrown.
override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback callback, object state)
 Asynchronous writes arent supported, a NotSupportedException is always thrown.
 DeflaterOutputStream (Stream baseOutputStream)
 Creates a new DeflaterOutputStream with a default Deflater and default buffer size.
 DeflaterOutputStream (Stream baseOutputStream, Deflater defl)
 Creates a new DeflaterOutputStream with the given Deflater and default buffer size.
 DeflaterOutputStream (Stream baseOutputStream, Deflater deflater, int bufsize)
 Creates a new DeflaterOutputStream with the given Deflater and buffer size.
override void Flush ()
 Flushes the stream by calling flush() on the deflater and then on the underlying stream. This ensures that all bytes are flushed.
virtual void Finish ()
 Finishes the stream by calling finish() on the deflater.
override void Close ()
 Calls finish() and closes the underlying stream when IsStreamOwner is true.
override void WriteByte (byte bval)
 Writes a single byte to the compressed output stream.
override void Write (byte[] buf, int off, int len)
 Writes bytes from an array to the compressed stream.

Protected Member Functions

void Deflate ()
 Deflates everything in the input buffers. This will call
def.deflate()</code> until all bytes from the input buffers
                    are processed.

byte EncryptByte ()
 Encrypt a single byte.
void EncryptBlock (byte[] buffer, int offset, int length)
 Encrypt a block of data.
void InitializePassword (string password)
 Initializes encryption keys based on given password.
void UpdateKeys (byte ch)
 Update encryption keys.

Protected Attributes

byte[] buf
 This buffer is used temporarily to retrieve the bytes from the deflater and write them to the underlying output stream.
Deflater def
 The deflater which is used to deflate the stream.
Stream baseOutputStream
 Base stream the deflater depends on.

Properties

bool IsStreamOwner
 Get/set flag indicating ownership of underlying stream. When the flag is true Close will close the underlying stream also.
bool CanPatchEntries
 Allows client to determine if an entry can be patched after its added.
override bool CanRead
 Gets value indicating stream can be read from.
override bool CanSeek
 Gets a value indicating if seeking is supported for this stream This property always returns false.
override bool CanWrite
 Get value indicating if this stream supports writing.
override long Length
 Get current length of stream.
override long Position
 The current position within the stream. Always throws a NotSupportedExceptionNotSupportedException.
string password = null
uint[] keys = null
string Password
 Get/set the password used for encryption. When null no encryption is performed.

Private Attributes

bool isClosed = false
bool isStreamOwner = true

Detailed Description

A special stream deflating or compressing the bytes that are written to it. It uses a Deflater to perform actual deflating.
Authors of the original java version : Tom Tromey, Jochen Hoenicke.

Definition at line 52 of file DeflaterOutputStream.cs.


Constructor & Destructor Documentation

ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::DeflaterOutputStream Stream  baseOutputStream  )  [inline]
 

Creates a new DeflaterOutputStream with a default Deflater and default buffer size.

Parameters:
baseOutputStream the output stream where deflated output should be written.

Definition at line 241 of file DeflaterOutputStream.cs.

ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::DeflaterOutputStream Stream  baseOutputStream,
Deflater  defl
[inline]
 

Creates a new DeflaterOutputStream with the given Deflater and default buffer size.

Parameters:
baseOutputStream the output stream where deflated output should be written.
defl the underlying deflater.

Definition at line 255 of file DeflaterOutputStream.cs.

ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::DeflaterOutputStream Stream  baseOutputStream,
Deflater  deflater,
int  bufsize
[inline]
 

Creates a new DeflaterOutputStream with the given Deflater and buffer size.

Parameters:
baseOutputStream The output stream where deflated output is written.
deflater The underlying deflater to use
bufsize The buffer size to use when deflating
Exceptions:
ArgumentOutOfRangeException bufsize is less than or equal to zero.
ArgumentException baseOutputStream does not support writing
ArgumentNullException deflater instance is null

Definition at line 281 of file DeflaterOutputStream.cs.


Member Function Documentation

override IAsyncResult ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::BeginRead byte[]  buffer,
int  offset,
int  count,
AsyncCallback  callback,
object  state
[inline]
 

Asynchronous reads are not supported a NotSupportedException is always thrown.

Parameters:
buffer 
offset 
count 
callback 
state 
Returns:
Exceptions:
NotSupportedException Any access

Definition at line 189 of file DeflaterOutputStream.cs.

override IAsyncResult ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::BeginWrite byte[]  buffer,
int  offset,
int  count,
AsyncCallback  callback,
object  state
[inline]
 

Asynchronous writes arent supported, a NotSupportedException is always thrown.

Parameters:
buffer 
offset 
count 
callback 
state 
Returns:
Exceptions:
NotSupportedException Any access

Definition at line 204 of file DeflaterOutputStream.cs.

override void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Close  )  [inline]
 

Calls finish() and closes the underlying stream when IsStreamOwner is true.

Definition at line 344 of file DeflaterOutputStream.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Deflate  )  [inline, protected]
 

Deflates everything in the input buffers. This will call

def.deflate()</code> until all bytes from the input buffers
                    are processed.

Definition at line 214 of file DeflaterOutputStream.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::EncryptBlock byte[]  buffer,
int  offset,
int  length
[inline, protected]
 

Encrypt a block of data.

Parameters:
buffer Data to encrypt. NOTE the original contents of the buffer are lost
offset Offset of first byte in buffer to encrypt
length Number of bytes in buffer to encrypt

Definition at line 434 of file DeflaterOutputStream.cs.

byte ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::EncryptByte  )  [inline, protected]
 

Encrypt a single byte.

Returns:
The encrypted value

Definition at line 415 of file DeflaterOutputStream.cs.

virtual void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Finish  )  [inline, virtual]
 

Finishes the stream by calling finish() on the deflater.

Exceptions:
SharpZipBaseException Not all input is deflated

Reimplemented in ICSharpCode::SharpZipLib::Zip::ZipOutputStream.

Definition at line 318 of file DeflaterOutputStream.cs.

override void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Flush  )  [inline]
 

Flushes the stream by calling flush() on the deflater and then on the underlying stream. This ensures that all bytes are flushed.

Definition at line 305 of file DeflaterOutputStream.cs.

References ICSharpCode::SharpZipLib::Zip::Compression::Deflater::Flush().

void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::InitializePassword string  password  )  [inline, protected]
 

Initializes encryption keys based on given password.

Definition at line 447 of file DeflaterOutputStream.cs.

override int ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Read byte[]  b,
int  off,
int  len
[inline]
 

Read a block of bytes from stream.

Exceptions:
NotSupportedException Any access

Definition at line 174 of file DeflaterOutputStream.cs.

override int ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::ReadByte  )  [inline]
 

Read a byte from stream advancing position by one.

Exceptions:
NotSupportedException Any access

Definition at line 165 of file DeflaterOutputStream.cs.

override long ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Seek long  offset,
SeekOrigin  origin
[inline]
 

Sets the current position of this stream to the given value. Not supported by this class!

Exceptions:
NotSupportedException Any access

Definition at line 147 of file DeflaterOutputStream.cs.

override void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::SetLength long  val  )  [inline]
 

Sets the length of this stream to the given value. Not supported by this class!

Exceptions:
NotSupportedException Any access

Definition at line 156 of file DeflaterOutputStream.cs.

void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::UpdateKeys byte  ch  )  [inline, protected]
 

Update encryption keys.

Definition at line 462 of file DeflaterOutputStream.cs.

override void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Write byte[]  buf,
int  off,
int  len
[inline]
 

Writes bytes from an array to the compressed stream.

Parameters:
buf The byte array
off The offset into the byte array where to start.
len The number of bytes to write.

Reimplemented in ICSharpCode::SharpZipLib::Zip::ZipOutputStream.

Definition at line 380 of file DeflaterOutputStream.cs.

override void ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::WriteByte byte  bval  )  [inline]
 

Writes a single byte to the compressed output stream.

Parameters:
bval The byte value.

Definition at line 361 of file DeflaterOutputStream.cs.


Member Data Documentation

Stream ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::baseOutputStream [protected]
 

Base stream the deflater depends on.

Definition at line 68 of file DeflaterOutputStream.cs.

byte [] ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::buf [protected]
 

This buffer is used temporarily to retrieve the bytes from the deflater and write them to the underlying output stream.

Definition at line 58 of file DeflaterOutputStream.cs.

Deflater ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::def [protected]
 

The deflater which is used to deflate the stream.

Definition at line 63 of file DeflaterOutputStream.cs.

bool ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::isClosed = false [private]
 

Definition at line 70 of file DeflaterOutputStream.cs.

bool ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::isStreamOwner = true [private]
 

Definition at line 71 of file DeflaterOutputStream.cs.


Property Documentation

bool ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::CanPatchEntries [get]
 

Allows client to determine if an entry can be patched after its added.

Definition at line 86 of file DeflaterOutputStream.cs.

override bool ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::CanRead [get]
 

Gets value indicating stream can be read from.

Definition at line 95 of file DeflaterOutputStream.cs.

override bool ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::CanSeek [get]
 

Gets a value indicating if seeking is supported for this stream This property always returns false.

Definition at line 105 of file DeflaterOutputStream.cs.

override bool ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::CanWrite [get]
 

Get value indicating if this stream supports writing.

Definition at line 114 of file DeflaterOutputStream.cs.

bool ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::IsStreamOwner [get, set]
 

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

Definition at line 78 of file DeflaterOutputStream.cs.

uint [] ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::keys = null [private]
 

Definition at line 390 of file DeflaterOutputStream.cs.

override long ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Length [get]
 

Get current length of stream.

Definition at line 123 of file DeflaterOutputStream.cs.

string ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Password [get, set]
 

Get/set the password used for encryption. When null no encryption is performed.

Definition at line 395 of file DeflaterOutputStream.cs.

string ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::password = null [private]
 

Definition at line 389 of file DeflaterOutputStream.cs.

override long ICSharpCode::SharpZipLib::Zip::Compression::Streams::DeflaterOutputStream::Position [get, set]
 

The current position within the stream. Always throws a NotSupportedExceptionNotSupportedException.

Exceptions:
NotSupportedException Any attempt to set position

Definition at line 134 of file DeflaterOutputStream.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