Platforms to show: All Mac Windows Linux Cross-Platform
Back to GZipFileMBS class.
GZipFileMBS.Adler32(start as UInt32, data as string) as UInt32
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Set start to 0 for the first call.
Later you can pass the result as the new start value to add data to your checksum.
This function is part of the zlib library and given as a free utility function to this class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
There is no need to call this method except you want to free all resources of this object now without waiting for Xojo to do it for you.
GZipFileMBS.CloseForString as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Only for use with CreateForString function.
Returns empty string on any error.
Some examples using this method:
GZipFileMBS.CRC32(start as UInt32, data as string) as UInt32
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Set start to 0 for the first call.
Later you can pass the result as the new start value to add data to your checksum.
This function is part of the zlib library and given as a free utility function to this class.
GZipFileMBS.CreateForString as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Use with the CloseForString method to compress data in memory.
Returns false on any error and true on success.
GZipFileMBS.Flush(flush as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The parameter flush is as in the zlib deflate() function.
Lasterror is set.
Flush should be called only when strictly necessary because it can degrade compression.
GZipFileMBS.Open(file as folderitem, mode as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The mode parameter is as in fopen ("rb" read binary or "wb" for write binary) but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman only compression as in "wb1h".
Open can be used to read a file which is not in gzip format; in this case Read will directly read from the file without decompression.
Open returns NULL if the file could not be opened or if there was insufficient memory to allocate the (de)compression state; errno can be checked to distinguish the two cases (if errno is zero, the zlib error is Z_MEM_ERROR).
Returns false on any error and true on success.
GZipFileMBS.OpenString(data as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 9.6 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as Open, but reading from the given string.
GZipFileMBS.Read(ByteCount as Int64) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns "" on any error.
May return less bytes than requested.
Lasterror is set.
GZipFileMBS.ReadByte as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
GZipFileMBS.ReadData(ByteCount as Int64) as Memoryblock
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 15.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns nil on any error.
May return less bytes than requested.
Lasterror is set.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Equal to: position=0
GZipFileMBS.SetParameter(level as Integer, strategy as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Lasterror is set.
Possible values:
FILTERED | 1 |
HUFFMAN_ONLY | 2 |
DEFAULT_STRATEGY | 0 |
GZipFileMBS.Write(data as Memoryblock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 15.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Lasterror is set.
See also:
GZipFileMBS.Write(data as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Note that encoding can make trouble as the raw bytes from the string are written.
Lasterror is set.
See also:
GZipFileMBS.WriteByte(data as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Compression | MBS Compression Plugin | 4.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The items on this page are in the following plugins: MBS Compression Plugin.