How to represent general binary data

原创 2007年10月09日 12:38:00

下面的内容摘自Symbian S60 3rd Edition SDK,先把英文原版贴在这里,等时间充足的时候我再把它翻译出来。How to represent general binary data《如何表示普通的二进制数据》

How 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.

To deal with general binary data, always explicitly construct an 8 bit variant descriptor. 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:

TUint8 data[6] = {0x00,0x01,0x02,0xAD,0xAE,0xAF};

construct a modifiable buffer descriptor using the default constructor as follows:

TBuf8<32> buffer;

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.

TInt index;
TInt counter;

Text and general binary data can be freely mixed and the following code is acceptable:

buffer.Append('A');
buffer.Append('B');
buffer.Append(0x11);

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.

 

Java学习笔记(17) Binary I/O

17.1 Introduction 1、Files can be classified as either text or binary.(文件可以被归类为文本文件和二进制文件) 2、A f...
  • Musetisa
  • Musetisa
  • 2016年06月24日 14:20
  • 2503

哈希学习(2)—— Hashing图像检索资源

哈希方法 公布代码的: CSDSH: Column Sampling based Discrete Supervised Hashing SGH :Scalable Graph Hashing ...
  • flowerboya
  • flowerboya
  • 2016年07月11日 00:25
  • 3087

appstore_被拒记录

发件人 Apple 1.0 二进制文件被拒绝 2016年3月24日 2.16 Details Your app declares support for audio in the UIBackgro...
  • u012576807
  • u012576807
  • 2016年03月24日 12:45
  • 13904

How to Create G/L General Ledger Account Master Record

Tutorial guides How to Create G/L General Ledger Account Master Record in SAP FICO. G/L General L...
  • dengyong818
  • dengyong818
  • 2014年04月25日 22:01
  • 719

How To Verify the Word Size (32bit vs 64bit) of the Oracle Binary on MS Windows systems

  • 2007年12月30日 22:19
  • 31KB
  • 下载

how many does the factorial of n(in binary data ) have zero?

how many does the factorial of n(in binary data ) have zero? 个人信息:就读于燕大本科软件工程专业 目前大三; 本人博客:g...
  • cqs_2012
  • cqs_2012
  • 2014年05月06日 18:10
  • 721

How to Draw a Balanced Binary Tree ?

+
  • perfectlife_2009
  • perfectlife_2009
  • 2013年11月03日 15:51
  • 808

CSharp Algorithm - How to traverse binary tree by depth (Part I)

CSharp Algorithm - How to traverse binary tree by depth (Part I)
  • garcon1986
  • garcon1986
  • 2013年07月10日 18:29
  • 1115

How to Check and Enable/Disable Oracle Binary Options (Doc ID 948061.1)

Applies to: Oracle Database - Enterprise Edition - Version 10.2.0.1 to 12.1.0.1 [Release 10.2 to 12...
  • xiangsir
  • xiangsir
  • 2014年01月03日 10:35
  • 4782

How to Draw a Binary Tree ?

+
  • perfectlife_2009
  • perfectlife_2009
  • 2013年10月27日 18:55
  • 904
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:How to represent general binary data
举报原因:
原因补充:

(最多只允许输入30个字)