Package one.nio.serial
Class ObjectOutputChannel
- java.lang.Object
-
- one.nio.serial.DataStream
-
- one.nio.serial.ObjectOutputChannel
-
- All Implemented Interfaces:
java.io.DataInput,java.io.DataOutput,java.io.ObjectInput,java.io.ObjectOutput,java.lang.AutoCloseable
public class ObjectOutputChannel extends DataStream
-
-
Field Summary
Fields Modifier and Type Field Description private longbytesWrittenprivate java.nio.channels.WritableByteChannelchprivate SerializationContextcontextprivate long[]serializerSetprivate intserializerSetSize-
Fields inherited from class one.nio.serial.DataStream
address, array, FIRST_BOOT_UID, limit, offset, REF_EMBEDDED, REF_NULL, REF_RECURSIVE, REF_RECURSIVE2
-
-
Constructor Summary
Constructors Constructor Description ObjectOutputChannel(java.nio.channels.WritableByteChannel ch)ObjectOutputChannel(java.nio.channels.WritableByteChannel ch, int bufSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanaddSerializer(long uid)protected longalloc(int size)voidclose()voidflush()longgetBytesWritten()private voidgrow(int size)voidreset()private voidresizeSerializerSet()voidwriteObject(java.lang.Object obj)-
Methods inherited from class one.nio.serial.DataStream
address, array, available, byteBuffer, count, newScope, read, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readRef, readShort, readTo, readUnsignedByte, readUnsignedShort, readUTF, register, skip, skipBytes, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeFrom, writeInt, writeLong, writeShort, writeUTF
-
-
-
-
Field Detail
-
ch
private final java.nio.channels.WritableByteChannel ch
-
context
private final SerializationContext context
-
serializerSet
private long[] serializerSet
-
serializerSetSize
private int serializerSetSize
-
bytesWritten
private long bytesWritten
-
-
Method Detail
-
getBytesWritten
public long getBytesWritten()
-
writeObject
public void writeObject(java.lang.Object obj) throws java.io.IOException- Specified by:
writeObjectin interfacejava.io.ObjectOutput- Overrides:
writeObjectin classDataStream- Throws:
java.io.IOException
-
reset
public void reset()
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.ObjectOutput- Overrides:
flushin classDataStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.ObjectInput- Specified by:
closein interfacejava.io.ObjectOutput- Overrides:
closein classDataStream- Throws:
java.io.IOException
-
alloc
protected long alloc(int size) throws java.io.IOException- Overrides:
allocin classDataStream- Throws:
java.io.IOException
-
grow
private void grow(int size) throws java.io.IOException- Throws:
java.io.IOException
-
addSerializer
private boolean addSerializer(long uid)
-
resizeSerializerSet
private void resizeSerializerSet()
-
-