The Essential JViews Framework > Managers > Saving and Reading

The manager provides facilities to save its contents to a file. The resulting file is an ASCII or binary file in the .ivl format that contains information about the layers and the graphic objects. The saving methods are as follows:

void write(OutputStream stream, boolean binary) throws IOException 
void write(String filename) throws IOException
void write(String filename, boolean binary) throws IOException

You can save data in either an ASCII or binary file, the binary format being, however, more compact and faster to read than the ASCII format.

void read(InputStream stream) throws IOException, IlvReadFileException
void read(String filename) throws IOException, IlvReadFileException
void read(URL url) throws IOException, IlvReadFileException

The read methods may throw an exception in the following situations:

Whether the .ivl file is an ASCII or binary file is detected automatically by the read methods.

You can save/read the information on your own graphic objects by providing the appropriate methods when creating your own graphic object class. For more information, see Input/Output Operations and also Saving and Loading the Object Description.

Important
The recommended way to serialize any IlvManager object is through IVL serialization and not Java serialization. Serialization cannot work for managers that contain graphic objects such as IlvIcon or some other classes, since these classes manage internally Java SE objects that are not serializable.