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
AnObjectOutput
which writes data to anOutput
.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 timewriteObject(Object)
is invoked since we need to allow unknown null objects.- Author:
- Robert DiFalco
-
-
Field Summary
-
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 object)
-
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
-
-
-
-
Method Detail
-
writeObject
public void writeObject(java.lang.Object object) 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
- Overrides:
close
in classKryoDataOutput
- Throws:
java.io.IOException
-
-