Initialize the ZlibCodec for deflation operation.
Declaration Syntax
C# | C# | Visual Basic | Visual Basic | Visual C++ | Visual C++ | F# | F# |
public int InitializeDeflate()
public int InitializeDeflate()
Public Function InitializeDeflate As Integer
Public Function InitializeDeflate As Integer
public: int InitializeDeflate()
public: int InitializeDeflate()
member InitializeDeflate : unit -> int
member InitializeDeflate : unit -> int
Return Value
Int32
Z_OK if all goes well. You generally don't need to check the return code.
Z_OK if all goes well. You generally don't need to check the return code.
Remarks
The codec will use the MAX window bits and the default level of compression.
Examples
Copy | |
---|---|
int bufferSize = 40000; byte[] CompressedBytes = new byte[bufferSize]; byte[] DecompressedBytes = new byte[bufferSize]; ZlibCodec compressor = new ZlibCodec(); compressor.InitializeDeflate(CompressionLevel.Default); compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); compressor.NextIn = 0; compressor.AvailableBytesIn = compressor.InputBuffer.Length; compressor.OutputBuffer = CompressedBytes; compressor.NextOut = 0; compressor.AvailableBytesOut = CompressedBytes.Length; while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) { compressor.Deflate(FlushType.None); } while (true) { int rc= compressor.Deflate(FlushType.Finish); if (rc == ZlibConstants.Z_STREAM_END) break; } compressor.EndDeflate(); |
Assembly: Keyoti.RapidSpell.NET4 (Module: Keyoti.RapidSpell.NET4.dll) Version: 6.2.21.412