decodeBytes(forKey:returnedLength:)
Decodes a stream of bytes associated with a given key.
Declaration
func decodeBytes(forKey key: String, returnedLength lengthp: UnsafeMutablePointer<Int>?) -> UnsafePointer<UInt8>?Parameters
- key:
A key in the archive within the current decoding scope.
keymust not benil. - lengthp:
Upon return, contains the number of bytes returned.
Return Value
The stream of bytes associated with the key key. Returns NULL if key does not exist.
Discussion
The returned value is a pointer to a temporary buffer owned by the receiver. The buffer goes away with the unarchiver, not the containing autorelease pool block. You must copy the bytes into your own buffer if you need the data to persist beyond the life of the receiver.