Class KryoObjectOutput

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

    public class KryoObjectOutput
    extends KryoDataOutput
    implements java.io.ObjectOutput
    A kryo adapter for the ObjectOutput class. Note that this is not a Kryo implementation of ObjectOutputStream which has special handling for default 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.
    • Field Detail

      • kryo

        private final Kryo kryo
    • Constructor Detail

      • KryoObjectOutput

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

      • writeObject

        public void writeObject​(java.lang.Object obj)
                         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
        Throws:
        java.io.IOException