相关疑难解决方法(0)

如何从Adobe AIR中的文件流中获取bytearray?

我读有限(小 - 15 - 500 MB文件).我需要能够将所有文件字节放入一个单独的bytearray中.所以我有一个功能:

        [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);
        }
Run Code Online (Sandbox Code Playgroud)

但它不起作用=( - 给我错误:错误#2030:遇到文件结束.

如何从流中获取完整的bytearray以将其用作普通的bytearray?

air flash actionscript bytearray file

2
推荐指数
1
解决办法
9461
查看次数

标签 统计

actionscript ×1

air ×1

bytearray ×1

file ×1

flash ×1