public interface FastSerializable
Classes implementing FastSerializable should provide a public constructor that takes either:
DataInput
argument; or
DataInput
argument and a ClassLoader
argument.
DataInput
stream. The ClassLoader argument,
if included, can be used to resolve any application-specific classes stored in the
stream. The FastSerialize framework generates code invoking either constructor
to build new objects when deserializing. If both constructors are present in a
given class then the two-argument constructor is used as first preference.
Some caveats apply to objects implementing FastSerializable:
Modifier and Type | Method and Description |
---|---|
void |
toStream(DataOutput stream)
Serialize the state of this object to a stream.
|
void toStream(DataOutput stream) throws IOException
stream
- the stream to serialize to.IOException
- if an error occurs during serialization