Chilkat VB.NET Gzip Class Reference
Gzip
GZip compression component.
Object Creation
(C#)
Chilkat.Gzip obj = new Chilkat.Gzip();
(VB.NET)
Dim obj As New Chilkat.Gzip()
Properties
Comment As String
Specifies an optional comment string that can be embedded within the .gz when any Compress* method is called.
EnableEvents As Boolean
This property must be set to true to enable events. By default, it is false.
ExtraData As Byte()
Optional extra-data that can be included within a .gz when a Compress* method is called.
Filename As String
The filename that is embedded within the .gz during any Compress* method call. When extracting from a .gz using applications such as WinZip, this will be the filename that is created.
LastErrorHtml As String (ReadOnly)
Error information in HTML format for the last method called.
LastErrorText As String (ReadOnly)
Error information in plain-text format for the last method called.
LastErrorXml As String (ReadOnly)
Error information in XML format for the last method called.
LastMod As Date
The last-modification date/time to be embedded within the .gz when a Compress* method is called. By default, the current system date/time is used.
UseCurrentDate As Boolean
To be documented soon...
Version As String (ReadOnly)
Version of the component, such as "1.0.0"
Methods
Function CompressFile(ByVal inFilename As String, ByVal outGzipFilename As String) As Boolean
Compresses a file to create a GZip compressed file (.gz). Returns true for success, false for failure.
Function CompressFile2(ByVal inFilename As String, ByVal embeddedFilename As String, ByVal outGzipFilename As String) As Boolean
Compresses a file to create a GZip compressed file (.gz). inFilename is the actual filename on disk. embeddedFilename is the filename to be embedded in the .gz such that when it is un-gzipped, this is the name of the file that will be created. Returns true for success, false for failure.
Function CompressFileToMem(ByVal inFilename As String) As Byte()
Gzip compresses a file to an in-memory image of a .gz file. Returns a NULL object reference on failure. Returns Nothing on failure
Function CompressMemToFile(ByVal inData As Byte(), ByVal outFilename As String) As Boolean
Gzip compresses and creates a .gz file from in-memory data. Returns true for success, false for failure.
Function CompressMemory(ByVal inData As Byte()) As Byte()
Compresses in-memory data to an in-memory image of a .gz file. Returns Nothing on failure
Function CompressString(ByVal inString As String, ByVal outCharset As String) As Byte()
Gzip compresses a string and writes the output to a byte array. The string is first converted to the charset specified by outCharset. Typical charsets are "utf-8", "iso-8859-1", "shift_JIS", etc. Returns Nothing on failure Full List of Charset Names
Function CompressStringToFile(ByVal inStr As String, ByVal outCharset As String, ByVal outFilename As String) As Boolean
Gzip compresses a string and writes the output to a .gz compressed file. The string is first converted to the charset specified by ARG2. Typical charsets are "utf-8", "iso-8859-1", "shift_JIS", etc. Returns true for success, false for failure. Full List of Charset Names
Function Decode(ByVal str As String, ByVal encoding As String) As Byte()
To be documented soon...
Function DeflateStringENC(ByVal inString As String, ByVal charsetName As String, ByVal outputEncoding As String) As String
Provides the ability to use the zip/gzip's deflate algorithm directly to compress a string. Internal to this method, inString is first converted to the charset specified by charsetName. The data is then compressed using the deflate compression algorithm. The binary output is then encoded according to outputEncoding. Possible values for outputEncoding are "hex", "base64", "url", and "quoted-printable". Returns Nothing on failure Full List of Charset Names
Function ExamineFile(ByVal inGzFilename As String) As Boolean
To be documented soon...
Function ExamineMemory(ByVal inGzData As Byte()) As Boolean
To be documented soon...
Function InflateStringENC(ByVal inString As String, ByVal convertFromCharset As String, ByVal inputEncoding As String) As String
This the reverse of DeflateStringENC.
The input string is first decoded according to inputEncoding. (Possible values for inputEncoding are "hex", "base64", "url", and "quoted-printable".) The compressed data is then inflated, and the result is then converted from convertFromCharset (if necessary) to return a string. Returns Nothing on failure
Function IsUnlocked() As Boolean
Returns true if the component has been unlocked.
Function ReadFile(ByVal filename As String) As Byte()
Reads a binary file into memory and returns the byte array. Note: This method does not parse a Gzip, it is only a convenience method for reading a binary file into memory. Returns Nothing on failure
Function SaveLastError(ByVal filename As String) As Boolean
Saves the last error information to an XML formatted file.
Function UnTarGz(ByVal gzFilename As String, ByVal destDir As String, ByVal bNoAbsolute As Boolean) As Boolean
Unpacks a .tar.gz file. The ungzip and untar occur in streaming mode. There are no temporary files and the memory footprint is constant (and small) while untarring. Returns true for success, false for failure.
Function UncompressFile(ByVal inFilename As String, ByVal outFilename As String) As Boolean
Un-Gzips a .gz file. The output filename is specified by the 2nd argument and not by the filename embedded within the .gz. Returns true for success, false for failure.
Function UncompressFileToMem(ByVal inFilename As String) As Byte()
Un-Gzips a .gz file directly to memory. Returns a NULL object reference on failure. Returns Nothing on failure
Function UncompressFileToString(ByVal gzFilename As String, ByVal charset As String) As String
Uncompresses a .gz file that contains a text file. The contents of the text file are returned as a string. The character encoding of the text file is specified by charset. Typical charsets are "iso-8859-1", "utf-8", "windows-1252", "shift_JIS", "big5", etc. Returns Nothing on failure List of Valid Charsets
Function UncompressMemToFile(ByVal inData As Byte(), ByVal outFilename As String) As Boolean
Un-Gzips from an in-memory image of a .gz file to a file. Returns true for success, false for failure.
Function UncompressMemory(ByVal inData As Byte()) As Byte()
Un-Gzips from an in-memory image of a .gz file directly into memory. Returns a NULL object reference on failure. Returns Nothing on failure
Function UncompressString(ByVal inData As Byte(), ByVal inCharset As String) As String
The reverse of CompressString.
The bytes in inData are uncompressed, then converted from inCharset (if necessary) to return a string. Returns Nothing on failure Full List of Charset Names
Function UnlockComponent(ByVal unlockCode As String) As Boolean
Unlocks the component allowing for the full functionality to be used. Returns true for success, false for failure.
Function WriteFile(ByVal filename As String, ByVal binaryData As Byte()) As Boolean
A convenience method for writing a binary byte array to a file. Returns true for success, false for failure.
Function XfdlToXml(ByVal xfldData As String) As String
Converts base64-gzip .xfdl data to a decompressed XML string. The xfldData contains the base64 data. This method returns the decoded/decompressed XML string. Returns Nothing on failure
|