Flash Player 10 and AIR allow loading files from your local system as well as saving files. Once the files are loaded you have access to the ByteArray.
Convert ByteArray into an image
You can easily convert the ByteArray into an image:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(event:Event):void
{
event.currentTarget.removeEventListener(event.type, arguments.callee);
image.source=loader.content;
});
loader.loadBytes(event.file.fileContent);
Play ByteArray
Unfortunately, you cannot set the bytes of a video stream through the NetStream Object. What you can do is write the URLStream’s bytes to a local file, and then pass that file to the NetStream object. You can do a workaround such as writing out the URLStream’s bytes as they come in with the help of the “append” method.
What it means is that you cannot play ByteArray in AIR or Flex Application. I know that that feature is on the Adobe’s team list but until they adjust the code you will have to find a workaround.



















I have files that are stored on a secure server. Our flex app can retrieve theses file by making a call to our server api (managed by blazeds). The api will send these files to the client in the form of a ByteArray. In our flex app we need to provide a utility to enable the user to view these files. It appears that we are out of luck here based on your comments. Is there no work around you can think of? Writing the stream to a local file in not an option in our case.
Thanks for any advise.
What type of format are the original files? are you using AIR?
Hi
Can I write a series of bytes in python or C to the disk and then make flash load the file and interpret it as an image?
It should work!