Construct an 8 bit variant descriptor to represent general binary data.
The kind of data represented or contained by descriptors is not restricted to text. Descriptors can also handle general binary data.
Binary data should always be treated as 8 bit data regardless of the build.
For example, starting with an area in memory initialised with binary data as follows:
construct a modifiable buffer descriptor using the default constructor as follows:
The following code fragment puts the binary data into the descriptor and appends a number of single byte values. The length of the buffer is 9, the maximum length is 32 and the size is 9 regardless of the build.
Text and general binary data can be freely mixed and the following code is acceptable:
Note that fixed length C++ arrays such as data above can be packaged inside a thin wrapper class, a TFixedArray<class T,TInt S> type, to guarantee that all array accesses are safe.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License v1.0.