IPersistable Interface

IPersistable Interface

This Package | All Packages

public interface IPersistable

Allows an object to be persisted to a stream and depersisted from a stream. You must implement a constructor that takes an IDataStream to implement IPersistable correctly.

Methods
Name Description
getExtension() Retrieves the extension for the file name for the stream.
save(IDataStream stream) Persists the object.

Methods

IPersistable.getExtension

Syntax
public String getExtension();
Return Value

Returns a string containing the file name extension, such as bmp, or wav, or null if there is no extension.

Description

Retrieves the extension for the file name for the stream.

IPersistable.save

Syntax
public void save( IDataStream stream );
Description

Persists the object. This method takes a stream into which it can save itself. It can return an extension (bmp,wav) if the stream is saved to a file, or it can return null.