Interface StreamSerializer<T>

Type Parameters:
T - type of the serialized object
All Superinterfaces:
All Known Implementing Classes:

public interface StreamSerializer<T>
extends Serializer
A base class for custom serialization. User can register custom serializer like following:
     final SerializerConfig serializerConfig = new SerializerConfig();
     serializerConfig.setImplementation(new StreamSerializer<Person>() {
          public int getTypeId() {


          public void destroy() {


          public void write(ObjectDataOutput out, Person object) throws IOException {


          public Person read(ObjectDataInput in) throws IOException {



There is another class with byte arrays can be used instead ıf this interface see ByteArraySerializer.

C++ and C# clients also have compatible methods so that with custom serialization client can also be used

Note that read and write methods should be compatible

  • Method Summary

    Modifier and Type Method Description
    T read​(ObjectDataInput in)
    Reads object from objectDataInputStream
    void write​(ObjectDataOutput out, T object)
    This method writes object to ObjectDataOutput

    Methods inherited from interface com.hazelcast.nio.serialization.Serializer

    destroy, getTypeId