开发者

AS3 ByteArray with multiple parts

开发者 https://www.devze.com 2023-03-08 14:05 出处:网络
I\'m thinking about distributing bytes of a SWF into multiple files, how can i put a set of bytes in different parts into one byte array?

I'm thinking about distributing bytes of a SWF into multiple files, how can i put a set of bytes in different parts into one byte array?

E.G:

var bytesPartOne:ByteArray;
var bytesPartTwo:ByteArr开发者_如何学Pythonay;
var bytesPartThree:ByteArray;
var bytesPartFour:ByteArray;

Into one byte array?

var totalBytes:ByteArray;

Also would reading partial bytes into a byte array work?


Into one byte array?

var totalBytes:ByteArray = new ByteArray;
totalBytes.writeBytes(bytesPartOne);
totalBytes.writeBytes(bytesPartTwo);
totalBytes.writeBytes(bytesPartThree);
totalBytes.writeBytes(bytesPartFour);

Note : Be sure that bytesPartOne/two/Three/Four have position set to zero (can be done by bytesPartOne.position = 0, ...)

Also would reading partial bytes into a byte array work?

What do you mean by partial bytes ?

0

精彩评论

暂无评论...
验证码 换一张
取 消