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...
|
| | DeflaterOutputStream (Stream baseOutputStream) |
| | Creates a new DeflaterOutputStream with a default Deflater and default buffer size.
|
| | DeflaterOutputStream (Stream baseOutputStream, Deflater deflater) |
| | Creates a new DeflaterOutputStream with the given Deflater and default buffer size.
|
| | DeflaterOutputStream (Stream baseOutputStream, Deflater deflater, int bufferSize) |
| | Creates a new DeflaterOutputStream with the given Deflater and buffer size.
|
| virtual void | Finish () |
| | Finishes the stream by calling finish() on the deflater.
|
| 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 value) |
| | 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[] buffer, int offset, int count) |
| | 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.
|
| 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.
|
| override void | Close () |
| | Calls Finish and closes the underlying stream when IsStreamOwner is true.
|
| override void | WriteByte (byte value) |
| | Writes a single byte to the compressed output stream.
|
| override void | Write (byte[] buffer, int offset, int count) |
| | Writes bytes from an array to the compressed stream.
|
|
| 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 | InitializeAESPassword (ZipEntry entry, string rawPassword, out byte[] salt, out byte[] pwdVerifier) |
| | Initializes encryption keys based on given password.
|
| void | Deflate () |
| | Deflates everything in the input buffers. This will call.
|
|
| byte[] | AESAuthCode |
| | Returns the 10 byte AUTH CODE to be appended immediately following the AES data stream.
|
| Deflater | deflater_ |
| | The deflater which is used to deflate the stream.
|
| Stream | baseOutputStream_ |
| | Base stream the deflater depends on.
|
|
| bool | IsStreamOwner [get, set] |
| | Get/set flag indicating ownership of the underlying stream. When the flag is true Close will close the underlying stream also.
|
| bool | CanPatchEntries [get] |
| | Allows client to determine if an entry can be patched after its added.
|
| string | Password [get, set] |
| | Get/set the password used for encryption.
|
| override bool | CanRead [get] |
| | Gets value indicating stream can be read from.
|
| override bool | CanSeek [get] |
| | Gets a value indicating if seeking is supported for this stream This property always returns false.
|
| override bool | CanWrite [get] |
| | Get value indicating if this stream supports writing.
|
| override long | Length [get] |
| | Get current length of stream.
|
| override long | Position [get, set] |
| | Gets the current position within the stream.
|
|
| static RNGCryptoServiceProvider | _aesRnd |
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.
◆ DeflaterOutputStream() [1/3]
| ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.DeflaterOutputStream |
( |
Stream | baseOutputStream | ) |
|
Creates a new DeflaterOutputStream with a default Deflater and default buffer size.
- Parameters
-
| baseOutputStream | the output stream where deflated output should be written. |
◆ DeflaterOutputStream() [2/3]
| ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.DeflaterOutputStream |
( |
Stream | baseOutputStream, |
|
|
Deflater | deflater ) |
Creates a new DeflaterOutputStream with the given Deflater and default buffer size.
- Parameters
-
| baseOutputStream | the output stream where deflated output should be written. |
| deflater | the underlying deflater. |
◆ DeflaterOutputStream() [3/3]
| ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.DeflaterOutputStream |
( |
Stream | baseOutputStream, |
|
|
Deflater | deflater, |
|
|
int | bufferSize ) |
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 |
| bufferSize | The buffer size in bytes to use when deflating (minimum value 512) |
- Exceptions
-
| ArgumentOutOfRangeException | bufsize is less than or equal to zero. |
| ArgumentException | baseOutputStream does not support writing |
| ArgumentNullException | deflater instance is null |
◆ BeginRead()
| override IAsyncResult ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.BeginRead |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count, |
|
|
AsyncCallback | callback, |
|
|
object | state ) |
Asynchronous reads are not supported a NotSupportedException is always thrown.
- Parameters
-
| buffer | The buffer to read into. |
| offset | The offset to start storing data at. |
| count | The number of bytes to read |
| callback | The async callback to use. |
| state | The state to use. |
- Returns
- Returns an IAsyncResult
- Exceptions
-
| NotSupportedException | Any access |
◆ BeginWrite()
| override IAsyncResult ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.BeginWrite |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count, |
|
|
AsyncCallback | callback, |
|
|
object | state ) |
Asynchronous writes arent supported, a NotSupportedException is always thrown.
- Parameters
-
| buffer | The buffer to write. |
| offset | The offset to begin writing at. |
| count | The number of bytes to write. |
| callback | The AsyncCallback to use. |
| state | The state object. |
- Returns
- Returns an IAsyncResult.
- Exceptions
-
| NotSupportedException | Any access |
◆ Close()
| override void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Close |
( |
| ) |
|
◆ Deflate()
| void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Deflate |
( |
| ) |
|
|
protected |
Deflates everything in the input buffers. This will call.
until all bytes from the input buffers are processed.
◆ EncryptBlock()
| void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.EncryptBlock |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | length ) |
|
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 |
◆ Finish()
| virtual void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Finish |
( |
| ) |
|
|
virtual |
◆ Flush()
| override void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Flush |
( |
| ) |
|
Flushes the stream by calling Flush on the deflater and then on the underlying stream. This ensures that all bytes are flushed.
◆ GetAuthCodeIfAES()
| void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.GetAuthCodeIfAES |
( |
| ) |
|
|
private |
◆ InitializeAESPassword()
| void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.InitializeAESPassword |
( |
ZipEntry | entry, |
|
|
string | rawPassword, |
|
|
out byte[] | salt, |
|
|
out byte[] | pwdVerifier ) |
|
protected |
Initializes encryption keys based on given password.
◆ InitializePassword()
| void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.InitializePassword |
( |
string | password | ) |
|
|
protected |
Initializes encryption keys based on given password .
- Parameters
-
◆ Read()
| override int ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Read |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
Read a block of bytes from stream.
- Parameters
-
| buffer | The buffer to store read data in. |
| offset | The offset to start storing at. |
| count | The maximum number of bytes to read. |
- Returns
- The actual number of bytes read. Zero if end of stream is detected.
- Exceptions
-
| NotSupportedException | Any access |
◆ ReadByte()
| override int ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.ReadByte |
( |
| ) |
|
Read a byte from stream advancing position by one.
- Returns
- The byte read cast to an int. THe value is -1 if at the end of the stream.
- Exceptions
-
| NotSupportedException | Any access |
◆ Seek()
| override long ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Seek |
( |
long | offset, |
|
|
SeekOrigin | origin ) |
Sets the current position of this stream to the given value. Not supported by this class!
- Parameters
-
| offset | The offset relative to the origin to seek. |
| origin | The SeekOrigin to seek from. |
- Returns
- The new position in the stream.
- Exceptions
-
| NotSupportedException | Any access |
◆ SetLength()
| override void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.SetLength |
( |
long | value | ) |
|
Sets the length of this stream to the given value. Not supported by this class!
- Parameters
-
| value | The new stream length. |
- Exceptions
-
| NotSupportedException | Any access |
◆ Write()
| override void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Write |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
Writes bytes from an array to the compressed stream.
- Parameters
-
| buffer | The byte array |
| offset | The offset into the byte array where to start. |
| count | The number of bytes to write. |
◆ WriteByte()
| override void ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.WriteByte |
( |
byte | value | ) |
|
Writes a single byte to the compressed output stream.
- Parameters
-
◆ _aesRnd
| RNGCryptoServiceProvider ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream._aesRnd |
|
staticprivate |
◆ AESAuthCode
| byte [] ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.AESAuthCode |
|
protected |
Returns the 10 byte AUTH CODE to be appended immediately following the AES data stream.
◆ baseOutputStream_
| Stream ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.baseOutputStream_ |
|
protected |
Base stream the deflater depends on.
◆ buffer_
| byte [] ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.buffer_ |
|
private |
This buffer is used temporarily to retrieve the bytes from the deflater and write them to the underlying output stream.
◆ cryptoTransform_
| ICryptoTransform ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.cryptoTransform_ |
|
private |
◆ deflater_
| Deflater ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.deflater_ |
|
protected |
The deflater which is used to deflate the stream.
◆ isClosed_
| bool ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.isClosed_ |
|
private |
◆ isStreamOwner_
| bool ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.isStreamOwner_ = true |
|
private |
◆ password
| string ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.password |
|
private |
◆ CanPatchEntries
| bool ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.CanPatchEntries |
|
get |
Allows client to determine if an entry can be patched after its added.
◆ CanRead
| override bool ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.CanRead |
|
get |
Gets value indicating stream can be read from.
◆ CanSeek
| 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.
◆ CanWrite
| override bool ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.CanWrite |
|
get |
Get value indicating if this stream supports writing.
◆ IsStreamOwner
| bool ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.IsStreamOwner |
|
getset |
Get/set flag indicating ownership of the underlying stream. When the flag is true Close will close the underlying stream also.
◆ Length
| override long ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Length |
|
get |
Get current length of stream.
◆ Password
| string ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Password |
|
getset |
Get/set the password used for encryption.
When set to null or if the password is empty no encryption is performed
◆ Position
| override long ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Position |
|
getset |
Gets the current position within the stream.
- Exceptions
-
| NotSupportedException | Any attempt to set position |
The documentation for this class was generated from the following file: