我认为这就是您要寻找的东西:http : //www.matthewflickinger.com/lab/whatsinagif/bits_and_bytes.asp
字节6-7(从0开始的索引)代表宽度,字节8-9代表高度。在这种情况下:
var source:ByteArray;
var aHeight:int;
var aWidth:int;
source.position = 6;
aWidth = source.readUnsignedByte();
aWidth += source.readUnsignedByte() << 8;
aHeight = source.readUnsignedByte();
aHeight += source.readUnsignedByte() << 8;
或者可替代地,仅readShort
用于获取两个字节的值(16位),而无需进行移位<<
...
aWidth = source.readShort();
aHeight = source.readShort();
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句