Platforms to show: All Mac Windows Linux Cross-Platform

CFBinaryDataMBS class

Super class: CFObjectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class CoreFoundation MBS MacCF Plugin ✅ Yes ❌ No ❌ No ✅ Yes All
A class for core foundation data.

If the release property is true, the destructor of this class will release the data reference.
This class works on Windows with QuickTime 7 installed.

This wraps a CFDataRef from Apple. It was named CFBinaryDataMBS instead of CFDataMBS over 10 years ago.
Subclass of the CFObjectMBS class.

  • 2 properties
    • property Data as Ptr   New in 25.2
    • property len as Integer
  • 13 methods
  • 9 constants

Base64 options

Constant Value Description
Base64DecodingIgnoreUnknownCharacters 1 Use the following option to modify the decoding algorithm so that it ignores unknown non-Base64 bytes, including line ending characters.
Base64Encoding64CharacterLineLength 1 Line length limit should be 64.
Base64Encoding76CharacterLineLength 2 Line length limit should be 76.
Base64EncodingEndLineWithCarriageReturn 16 use CR as line ending instead of CRLF.
Base64EncodingEndLineWithLineFeed 32 use LF as line ending instead of CRLF.

Compression Algorithm

Constant Value Description
CompressionAlgorithmLZ4 1 LZ4 is appropriate if compression speed is critical. LZ4 generally sacrifices compression ratio in order to achieve its greater speed. more
CompressionAlgorithmLZFSE 0 LZFSE is the recommended compression algorithm if you don't have a specific reason to use another algorithm. Note that LZFSE is intended for use with Apple devices only. This algorithm generally compresses better than Zlib, but not as well as LZMA. It is generally slower than LZ4.
CompressionAlgorithmLZMA 2 LZMA is appropriate if compression ratio is critical and memory usage and compression speed are not a factor. LZMA is an order of magnitude slower for both compression and decompression than other algorithms. It can also use a very large amount of memory, so if you need to compress large amounts of data on embedded devices with limited memory you should probably avoid LZMA. more
CompressionAlgorithmZlib 3 Zlib is appropriate if you want a good balance between compression speed and compression ratio, but only if you need interoperability with non-Apple platforms. Otherwise, LZFSE is generally a better choice than Zlib. more

Super class CFObjectMBS

Sub classes:

Blog Entries

Release notes

  • Version 25.2
    • Added base64EncodedData and base64DecodedData methods to CFBinaryDataMBS class.
    • Added compressedDataUsingAlgorithm and decompressedDataUsingAlgorithm methods to CFBinaryDataMBS class for LZ4, LZFSE, LZMA and ZLib.
    • Added constructor to CFBinaryDataMBS class to take ptr and size.
    • Added Data property to get a data pointer for CFBinaryDataMBS object.

Some useful global functions for this class:

Some methods using this class:

Some properties using for this class:

Some events using this class:

Some examples using this class:

Some related classes:


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


CFBagMBS   -   CFBooleanMBS


The biggest plugin in space...