Class KryoObjectOutput

  • All Implemented Interfaces:
    java.io.DataOutput, java.io.ObjectOutput, java.lang.AutoCloseable

    public class KryoObjectOutput
    extends KryoDataOutput
    implements java.io.ObjectOutput
    An ObjectOutput which writes data to an Output.

    Note this is not an implementation of ObjectOutputStream which has special handling for Java serialization and serialization extras like writeReplace. By default it will simply delegate to the appropriate Kryo method. Also, using it will currently add one extra byte for each time writeObject(Object) is invoked since we need to allow unknown null objects.

    Author:
    Robert DiFalco
    • Constructor Detail

      • KryoObjectOutput

        public KryoObjectOutput​(Kryo kryo,
                                Output output)
    • Method Detail

      • writeObject

        public void writeObject​(java.lang.Object object)
                         throws java.io.IOException
        Specified by:
        writeObject in interface java.io.ObjectOutput
        Throws:
        java.io.IOException
      • flush

        public void flush()
                   throws java.io.IOException
        Specified by:
        flush in interface java.io.ObjectOutput
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.ObjectOutput
        Overrides:
        close in class KryoDataOutput
        Throws:
        java.io.IOException