I read limited (small - 15 - 500 mb files). I need to be able to put all file bytes into one single bytearray. So I have a function:
[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);
}
But it does not work=( - gives me Error: Error #2030: End of file was encountered.
How to get a full bytearray from stream to use it as normal bytearray?