|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - the type of the instances to serializepublic interface Serializer<T>
Interface defining the contract used to transform types in a serial form. Implementations must be thread-safe and must define a constructor accepting a single ClassLoader parameter.
| Method Summary | |
|---|---|
boolean |
equals(T object,
java.nio.ByteBuffer binary)
Checks if the given instance and serial form are representations of the same instance. |
T |
read(java.nio.ByteBuffer binary)
Reconstructs an instance from the given serial form. |
java.nio.ByteBuffer |
serialize(T object)
Transforms the given instance into its serial form. |
| Method Detail |
|---|
java.nio.ByteBuffer serialize(T object)
throws java.io.IOException
object - the instance to serialize
java.io.IOException - if serialization fails
T read(java.nio.ByteBuffer binary)
throws java.io.IOException,
java.lang.ClassNotFoundException
binary - the binary representation of the serial form
java.io.IOException - if reading the byte buffer fails
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found
boolean equals(T object,
java.nio.ByteBuffer binary)
throws java.io.IOException,
java.lang.ClassNotFoundException
object - the instance to checkbinary - the serial form to check
true if both parameters represent the same instance, false otherwise
java.io.IOException - if reading the byte buffer fails
java.lang.ClassNotFoundException - if the type to de-serialize to cannot be found
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||