Package com.esotericsoftware.kryo.io
Class KryoObjectOutput
- java.lang.Object
-
- com.esotericsoftware.kryo.io.KryoDataOutput
-
- com.esotericsoftware.kryo.io.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 theObjectOutput
class. Note that this is not a Kryo implementation ofObjectOutputStream
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 timewriteObject(Object)
is invoked since we need to allow unknown null objects.
-
-
Field Summary
Fields Modifier and Type Field Description private Kryo
kryo
-
Fields inherited from class com.esotericsoftware.kryo.io.KryoDataOutput
output
-
-
Constructor Summary
Constructors Constructor Description KryoObjectOutput(Kryo kryo, Output output)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
writeObject(java.lang.Object obj)
-
Methods inherited from class com.esotericsoftware.kryo.io.KryoDataOutput
setOutput, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
kryo
private final Kryo kryo
-
-
Method Detail
-
writeObject
public void writeObject(java.lang.Object obj) throws java.io.IOException
- Specified by:
writeObject
in interfacejava.io.ObjectOutput
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.ObjectOutput
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.ObjectOutput
- Throws:
java.io.IOException
-
-