Platforms to show: All Mac Windows Linux Cross-Platform

BZip2CompressMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Compression MBS Compression Plugin 9.7 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A class for bzip2 compression.

See also BZip2DecompressMBS class.

Errors

Constant Value Description
kCONFIG_ERROR -9 Indicates that the library has been improperly compiled on your platform -- a major configuration error. Specifically, it means that sizeof(char), sizeof(short) and sizeof(int) are not 1, 2 and 4 respectively, as they should be. Note that the library should still work properly on 64-bit platforms which follow the LP64 programming model -- that is, where sizeof(long) and sizeof(void*) are 8. Under LP64, sizeof(int) is still 4, so libbzip2, which doesn't use the long type, is OK. more
kDATA_ERROR -4 Returned when a data integrity error is detected during decompression. Most importantly, this means when stored and computed CRCs for the data do not match. This value is also returned upon detection of any other anomaly in the compressed data.
kDATA_ERROR_MAGIC -5 As a special case of kDATA_ERROR, it is sometimes useful to know when the compressed stream does not start with the correct magic bytes ('B' 'Z' 'h').
kFINISH_OK 3 In Compress, the requested flush/finish/nothing-special action was completed successfully.
kFLUSH_OK 2 In Compress, the requested flush/finish/nothing-special action was completed successfully.
kIO_ERROR -6 Returned by Read and Write when there is an error reading or writing in the compressed file, and by ReadOpen and WriteOpen for attempts to use a file for which the error indicator (viz, ferror(f)) is set. On receipt of kIO_ERROR, the caller should consult errno and/or perror to acquire operating-system specific information about the problem.
kMEM_ERROR -3 Returned when a request to allocate memory failed. Note that the quantity of memory needed to decompress a stream cannot be determined until the stream's header has been read. So Decompress and Read may return kMEM_ERROR even though some of the compressed data has been read. The same is not true for compression; once CompressInit or WriteOpen have successfully completed, kMEM_ERROR cannot occur.
kOK 0 The requested action was completed successfully.
kOUTBUFF_FULL -8 Returned by BuffToBuffCompress and BuffToBuffDecompress to indicate that the output data will not fit into the output buffer provided.
kPARAM_ERROR -2 Returned when a parameter to a function call is out of range or otherwise manifestly incorrect. As with kSEQUENCE_ERROR, this denotes a bug in the client code. The distinction between kPARAM_ERROR and kSEQUENCE_ERROR is a bit hazy, but still worth making.
kRUN_OK 1 In Compress, the requested flush/finish/nothing-special action was completed successfully.
kSEQUENCE_ERROR -1 When using the library, it is important to call the functions in the correct sequence and with data structures (buffers etc) in the correct states. libbzip2 checks as much as it can to ensure this is happening, and returns kSEQUENCE_ERROR if not. Code which complies precisely with the function semantics, as detailed below, should never receive this value; such an event denotes buggy code which you should investigate.
kSTREAM_END 4 Compression of data was completed, or the logical stream end was detected during decompression.
kUNEXPECTED_EOF -7 Returned by Read when the compressed file finishes before the logical end of stream is detected.

Commands

Constant Value Description
kFINISH 2
kFLUSH 1
kRUN 0

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes

  • Version 24.3
    • Added OutputUsedSize and OutputPtr properties and a new Constructor to BZip2CompressMBS, ZLibDecompressMBS, BZip2DecompressMBS and ZLibDecompressMBS classes.
    • Added SetInput method taking ptr to ZLibDecompressMBS, ZLibCompressMBS, BZip2DecompressMBS and BZip2CompressMBS functions.

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


BlowfishMBS   -   BZip2DecompressMBS


The biggest plugin in space...