WBXML 1.3协议摘要
协议地址:WAP195
网络字节顺序:big-endian。
为什么要加0x40?
- When an element contains content (text nodes or child elements) but no attributes, you add a numeric value of 0x40to the byte code
- When the element contains one or more attributes but no content, add 0x80to the element byte code
- When the element contains both an attribute and content, add 0xC0 to the element bye code.
封装数据
Opaque Data
opaque = OPAQUE length *byte
其中,QPAQUE一个字节表示,内容是0xc3. length根据内容的字节长度确定,不包含标示位和长度位。
长度算法
length = data.getBytes().length.
length into 7bit bytes .Assume bytes.length = N
bytes[0] += 0x80;
bytes[1] += 0x80;
……
bytes[n-1] += 0x80;
------------------------------------------------------------------------------------------------------------------------------------------
需要荷兰版牛栏、荷兰美素、母婴用品的攻城师、设计师朋友,欢迎关顾【七彩母婴店】【http://qicaoyun.taobao.com】。凡是从博客园得知信息的,全店商品,均可优惠,请告知客服哦。你也可以通过淘代码【D5867219】,在淘宝搜索到我们。收藏有礼哦!