Platforms to show: All Mac Windows Linux Cross-Platform

ZLibDecompressMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Compression MBS Compression Plugin 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A class for zlib decompression.
Example
// we do a one off compression
Var data as string = "Hello World Hello World"
Var z As new ZLibcompressMBS

z.InitZip(9)
call z.SetInput(data)
z.ProcessZip
z.EndZip

Var CompressedData as string = z.GetOutput

// and one off decompression
Var d As New ZLibDecompressMBS
d.InitZip
call d.SetInput(CompressedData)
d.ProcessZip
d.EndZip

Var UncompressedData as string = d.GetOutput

If UncompressedData = data Then
MessageBox "match"
Else
MessageBox "no match"
end if

See also ArchiveReaderMBS and ArchiveWriterMBS classes for more features and compression formats.

See ZLibCompressMBS class to compress first.

Data Types

Constant Value Description
kASCII 1 ASCII
kBINARY 0 Binary
kTEXT 1 Text
kUNKNOWN 2 Unknown

Compression Levels

Constant Value Description
kBEST_COMPRESSION 9
kBEST_SPEED 1
kDEFAULT_COMPRESSION -1
kNO_COMPRESSION 0

Flush modes

Constant Value Description
kBLOCK 5
kFINISH 4
kFULL_FLUSH 3
kNO_FLUSH 0
kPARTIAL_FLUSH 1
kSYNC_FLUSH 2

Errors

Constant Value Description
kBUF_ERROR -5 Negative values are errors, positive values are used for special but normal events.
kDATA_ERROR -3 Negative values are errors, positive values are used for special but normal events.
kERRNO -1 Negative values are errors, positive values are used for special but normal events.
kMEM_ERROR -4 Negative values are errors, positive values are used for special but normal events.
kNEED_DICT 2 Negative values are errors, positive values are used for special but normal events.
kOK 0 Negative values are errors, positive values are used for special but normal events.
kSTREAM_END 1 Negative values are errors, positive values are used for special but normal events.
kSTREAM_ERROR -2 Negative values are errors, positive values are used for special but normal events.
kVERSION_ERROR -6 Negative values are errors, positive values are used for special but normal events.

Compression Strategies

Constant Value Description
kDEFAULT_STRATEGY 0
kFILTERED 1
kFIXED 4
kHUFFMAN_ONLY 2
kRLE 3

Compression Methods

Constant Value Description
kDEFLATED 8 The deflate compression method (the only one supported in this version)

This class has no sub classes.

Blog Entries

Xojo Developer Magazine

Release notes

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS Compression Plugin.


ZLibCompressMBS   -   ZStdMBS


The biggest plugin in space...