Deflater.Deflate Method (Byte[], Int32, Int32)

SharpZip Compression Library

SharpZip Compression Library

Deflater.Deflate Method (Byte[], Int32, Int32)

Deflates the current input block to the given array.

public int Deflate(
   byte[] output,
   int offset,
   int length
);

Parameters

output
Buffer to store the compressed data.
offset
Offset into the output array.
length
The maximum number of bytes that may be stored.

Return Value

The number of compressed bytes added to the output, or 0 if either needsInput() or finished() returns true or length is zero.

Exceptions

Exception Type Condition
InvalidOperationException If end() was previously called.
ArgumentOutOfRangeException If offset and/or length don't match the array length.

See Also

Deflater Class | ICSharpCode.SharpZipLib.Zip.Compression Namespace | Deflater.Deflate Overload List