【发布时间】:2010-05-27 13:54:15
【问题描述】:
我阅读有限(小 - 15 - 500 mb 文件)。 我需要能够将所有文件字节放入一个字节数组中。 所以我有一个功能:
[Bindable]
public var ba:ByteArray = new ByteArray;
//.... code ....//
protected function fileOpenSelected(event:Event):void
{
currentFile = event.target as File;
stream = new FileStream();
stream.openAsync(currentFile, FileMode.READ);
stream.readBytes(ba);
stream.close();
MyFunction(ba);
}
但它不起作用=( - 给我错误:错误 #2030:遇到文件结尾。
如何从流中获取完整的字节数组以将其用作普通字节数组?
【问题讨论】:
标签: flash file actionscript air bytearray