BinaryPacker.js
二进制数据打包器。
文档
如何使用
浏览器
< script src = "lib/BinaryPacker.js" > < / script >
< script src = "lib/BinaryPacker0x0001.js" > < / script >
< script >
var formatID = 0x0001; // RECT
var object = { x : 0 , y : 0 , w : 100 , h : 100 } ;
var packed = BinaryPacker.pack(object, formatID);
var unpacked = BinaryPacker.unpack(packed);
if ( object.x === unpacked.x &&
object.y === unpacked.y
1