Package com.hazelcast.nio.serialization
Interface DataSerializable
- All Known Subinterfaces:
IdentifiedDataSerializable
,Member
,TypedDataSerializable
- All Known Implementing Classes:
Address
,HazelcastExpiryPolicy
,MemberVersion
,PortableId
,ScheduledTaskHandler
,SimpleTokenCredentials
,UsernamePasswordCredentials
,Version
public interface DataSerializable
DataSerializable is a serialization method alternative to standard Java
serialization. DataSerializable is very similar to
Externalizable
and relies on reflection to create instances using class names.
Conforming classes must provide a no-arguments constructor to facilitate the creation of their instances during the deserialization. Anonymous, local and non-static member classes can't satisfy this requirement since their constructors are always accepting an instance of the enclosing class as an implicit argument, therefore they must be avoided.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Reads fields from the input streamvoid
Writes object fields to output stream
-
Method Details
-
writeData
Writes object fields to output stream- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Reads fields from the input stream- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-