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.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Reads fields from the input stream
    void
    Writes object fields to output stream
  • Method Details

    • writeData

      void writeData(ObjectDataOutput out) throws IOException
      Writes object fields to output stream
      Parameters:
      out - output
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
    • readData

      void readData(ObjectDataInput in) throws IOException
      Reads fields from the input stream
      Parameters:
      in - input
      Throws:
      IOException - if an I/O error occurs. In particular, an IOException may be thrown if the input stream has been closed.