开发者

convert a byte array to string at a particular index (Flex)

Im a bit of a newbie when it comes to Flash/Flex Builder. How do I convert a byte array to string at a particular ind开发者_开发问答ex? I got this (b is a byte array)

var s:String = b.readUTFBytes(4);

But I need to skip to a particular point in the byte array.

In C#, I can do this which would skip the first 8 bytes.

Encoding.UTF8.GetString(b, 8, 4);

How do I do the equivalent in Flash builder?


The help on ByteArrays has some good examples. Here is how I would do it.

bytes.position = 7;
trace((bytes.readUTFBytes(4)));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜