public class CachedData extends Object implements Externalizable
| Constructor and Description |
|---|
CachedData() |
| 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
|
byte[] |
getData() |
String |
getObjectId()
The object id must be unique, it is used to identify the object when loaded
even when it is obfuscated.
|
String |
getUrl() |
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
|
void |
setData(byte[] data) |
void |
setUrl(String url) |
public int getVersion()
getVersion in interface Externalizablepublic void externalize(DataOutputStream out) throws IOException
externalize in interface Externalizableout - the stream into which the object must be serializedIOException - the method may throw an exceptionpublic void internalize(int version,
DataInputStream in)
throws IOException
internalize in interface Externalizableversion - the version the class returned during the externalization processsin - the input stream used to load the classIOException - the method may throw an exceptionpublic String getObjectId()
ExternalizablegetObjectId in interface Externalizablepublic byte[] getData()
public void setData(byte[] data)
data - the data to setpublic String getUrl()
public void setUrl(String url)
url - the url to set