File Operation in Adobe AIR

In AIR application, the file operation is as the same as in other applications( application compiled from C++ etc.).  The size of the file that air can open only depends on the system.

Which class to handle file?

The FileStream Class is the major Class for operating content of a file. A FileStream object has two methods for opening a file. One is synchrony open, another is asynchrony. The open operation will decide the behavior of other file operation you perform on the FileStream object. If the object is opened in synchrony, the operations such as write and read will be also synchrony. It means that the application can’t do anything until the read is finished. If you open a file in asynchrony method by calling openAsync, all reading and writing operations will be asynchrony. The application should handle to get results of operation the events.

Why asynchrony open?

The asynchrony open is used when application need to write a large data fragment. These writing operations are time consuming. If you don’t want your application behaves like death, you should use asynchrony open. Or your application needs to read from a stream, the data is not all ready when the application open the stream file. The synchrony read can only read the data already exists.

Actually, When you open a file, the file is not loaded into memory, it just create a handle in system to identify the opened file. So there is no size limitation by AIR-self, but system.

This entry was posted on Tuesday, February 9th, 2010 at 11:24 am and is filed under flex air flash. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Post a Comment



To submit your comment, click the image below where it asks you to... Clickcha - The One-click Captcha