-
-
Notifications
You must be signed in to change notification settings - Fork 4
zlib.ZStream
zlib.ZStream
Protected Class ZStream
Implements Readable,WriteableThis represents a deflate stream. Depending on the initialization options this class can read/write streams compressed using deflate (with or without header/footer) or GZip.
A ZStream has a reference to a Writeable object to which all compressed output is ultimately written; this is the "output stream". Another reference is held to a Readable object which is the ultimate source for all compressed input; this is the "input stream".
Typically, when compressing you only specify the output stream and when decompressing only the input stream. However both may be used simultaneously and independently, for example if reading/writing compressed data to/from a socket.
This class implements the Readable and Writeable class interfaces.
- Close
- Constructor
- EOF
- Flush
- Lookahead
- Read
- ReadAll
- ReadError
- ReadLine
- Sync
- Write
- WriteError
- WriteLine
- BufferedReading As Boolean
- Dictionary As MemoryBlock
- Encoding As Integer
- IsReadable As Boolean
- IsWriteable As Boolean
- LastError As Int32
- Level As Integer
- Ratio As Single
- Strategy As Integer
- TotalIn As UInt32
- TotalOut As UInt32
This example creates an in-memory compression stream by calling Constructor(MemoryBlock), and writes some data that will be compressed using GZip at maximum compression:
Dim output As New MemoryBlock(0)
Dim compressor As New zlib.ZStream(output, zlib.Z_BEST_COMPRESSION, zlib.Z_DEFAULT_STRATEGY, zlib.GZIP_ENCODING)
compressor.Write("Hello, world!")
compressor.CloseWiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.