public interface Externalizable
Modifier and Type | Method and Description |
---|---|
void |
externalize(DataOutputStream out)
Allows us to store an object state, this method must be implemented
in order to save the state of an object
|
String |
getObjectId()
The object id must be unique, it is used to identify the object when loaded
even when it is obfuscated.
|
int |
getVersion()
Returns the version for the current persistance code, the version will be
pased to internalized thus allowing the internalize method to recognize
classes persisted in older revisions
|
void |
internalize(int version,
DataInputStream in)
Loads the object from the input stream and allows deserialization
|
int getVersion()
void externalize(DataOutputStream out) throws IOException
out
- the stream into which the object must be serializedIOException
- the method may throw an exceptionvoid internalize(int version, DataInputStream in) throws IOException
version
- the version the class returned during the externalization processsin
- the input stream used to load the classIOException
- the method may throw an exceptionString getObjectId()