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 |
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
- 13 methods
- method base64DecodedData(options as Integer = 0) as CFBinaryDataMBS New in 25.2
- method base64EncodedData(options as Integer = 0) as CFBinaryDataMBS New in 25.2
- method clone as CFBinaryDataMBS
- method compressedDataUsingAlgorithm(algorithm as Integer, byref ErrorCode as Integer, byref ErrorMessage as String) as CFBinaryDataMBS New in 25.2
- method Constructor(data as MemoryBlock)
- method Constructor(data as Ptr, Size as Integer) New in 25.2
- method Constructor(data as string)
- method decompressedDataUsingAlgorithm(algorithm as Integer, byref ErrorCode as Integer, byref ErrorMessage as String) as CFBinaryDataMBS New in 25.2
- method Edit as CFMutableBinaryDataMBS
- method Mem as Memoryblock
- method Mem(pos as Integer,len as Integer) as Memoryblock
- method Str as String
- method Str(pos as Integer,len as Integer) as String
- 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
- 5 properties
- property Handle as Integer
- property Hash as Integer
- property Lasterror as Integer
- property Type as Integer
- property TypeDescription as String
- 9 methods
- method close
- method DeepCopy as CFObjectMBS
- method EncodedData as MemoryBlock
- method Equal(o as CFObjectMBS) as boolean
- method ReleaseObject
- method RetainCount as Integer
- method RetainObject
- method XML as CFBinaryDataMBS
- method XMLdata as String
- shared method NewCFObject(handle as Integer) as CFObjectMBS
Sub classes:
Blog Entries
- MBS Xojo Plugins, version 25.2pr5
- MBS Xojo / Real Studio Plugins, version 13.4pr2
- MBS Real Studio Plugins, version 13.0pr1
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:
- CreateCFTimeZoneMBS(name as CFStringMBS, data as CFBinaryDataMBS) as CFTimeZoneMBS
- NewCFBinaryDataMBSMem(mem as memoryblock,len as Integer) as CFBinaryDataMBS
- NewCFBinaryDataMBSStr(s as string) as CFBinaryDataMBS
- NewCFObjectMBSFromXML(XMLdata as CFBinaryDataMBS) as CFObjectMBS
- NewCFObjectMBSFromXMLMT(XMLdata as CFBinaryDataMBS) as CFObjectMBS
Some methods using this class:
- CFCharacterSetMBS.NewCFCharacterSet(str as CFBinaryDataMBS) as CFCharacterSetMBS
- CFMutableBinaryDataMBS.AppendCFBinaryDataMBS(m as CFBinaryDataMBS)
- CFMutableBinaryDataMBS.ReplaceCFBinaryDataMBS(m as CFBinaryDataMBS,pos as Integer,len as Integer)
- CFMutableBinaryDataMBS.ReplaceCFBinaryDataMBS(m as CFBinaryDataMBS,pos as Integer,len as Integer,newlen as Integer)
- CFObjectMBS.XML as CFBinaryDataMBS
- CFSocketMBS.ConnectToAddress(address as CFBinaryDataMBS, timeout as Double) as Integer
- CFSocketMBS.PeerAddress as CFBinaryDataMBS
- CFSocketMBS.SendData(data as CFBinaryDataMBS, timeout as Double) as Integer
- CFTimeZoneMBS.Data as CFBinaryDataMBS
- SCPreferencesMBS.Signature as CFBinaryDataMBS
Some properties using for this class:
- CFHTTPMessageMBS.Body as CFBinaryDataMBS
- CFSocketMBS.Address as CFBinaryDataMBS
- MidiObjectMBS.BinaryProperty(name as CFStringMBS) as CFBinaryDataMBS
Some events using this class:
- CFSocketMBS.Callback(reason as Integer, address as CFBinaryDataMBS, data as memoryblock)
Some examples using this class:
- /MacCF/iTunes Playlists
- /MacCF/MIDI/Event Benchmark/MIDI Send
- /MacCF/MIDI/MIDI Send Keys
- /MacCF/MIDI/MIDI Source
- /MacCF/NewCFObjectMBSFromXML Test
- /MacCF/Plist Parsing
- /MacCocoa/Addressbook/Add Vcard to Addressbook
Some related classes:
- class CFCharacterSetMBS
- class CFHTTPMessageMBS
- class CFMutableBinaryDataMBS
- class CFObjectMBS
- class CFSocketMBS
- class CFStringMBS
- class CFTimeZoneMBS
- class MidiObjectMBS
- class SCPreferencesMBS
The items on this page are in the following plugins: MBS MacCF Plugin.
