Package one.nio.serial
Class ObjectInputChannel
- java.lang.Object
-
- one.nio.serial.DataStream
-
- one.nio.serial.ObjectInputChannel
-
- All Implemented Interfaces:
java.io.DataInput,java.io.DataOutput,java.io.ObjectInput,java.io.ObjectOutput,java.lang.AutoCloseable
public class ObjectInputChannel extends DataStream
-
-
Field Summary
Fields Modifier and Type Field Description private longbytesReadprivate intcapacityprivate java.nio.channels.ReadableByteChannelchprivate java.lang.Object[]contextprivate intcontextSizeprivate static java.lang.Object[]EMPTY_CONTEXTprivate static intINITIAL_CAPACITY-
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 ObjectInputChannel(java.nio.channels.ReadableByteChannel ch)ObjectInputChannel(java.nio.channels.ReadableByteChannel ch, int bufSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longalloc(int size)voidclose()private voidfetch(int size)longgetBytesRead()java.lang.ObjectreadObject()voidregister(java.lang.Object obj)voidreset()-
Methods inherited from class one.nio.serial.DataStream
address, array, available, byteBuffer, count, flush, newScope, read, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readRef, readShort, readTo, readUnsignedByte, readUnsignedShort, readUTF, skip, skipBytes, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeFrom, writeInt, writeLong, writeObject, writeShort, writeUTF
-
-
-
-
Field Detail
-
EMPTY_CONTEXT
private static final java.lang.Object[] EMPTY_CONTEXT
-
INITIAL_CAPACITY
private static final int INITIAL_CAPACITY
- See Also:
- Constant Field Values
-
ch
private final java.nio.channels.ReadableByteChannel ch
-
capacity
private int capacity
-
context
private java.lang.Object[] context
-
contextSize
private int contextSize
-
bytesRead
private long bytesRead
-
-
Method Detail
-
getBytesRead
public long getBytesRead()
-
readObject
public java.lang.Object readObject() throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readObjectin interfacejava.io.ObjectInput- Overrides:
readObjectin classDataStream- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
reset
public void reset()
-
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
-
register
public void register(java.lang.Object obj)
- Overrides:
registerin classDataStream
-
alloc
protected long alloc(int size) throws java.io.IOException- Overrides:
allocin classDataStream- Throws:
java.io.IOException
-
fetch
private void fetch(int size) throws java.io.IOException- Throws:
java.io.IOException
-
-