Package one.nio.serial
Class ObjectInputChannel
- java.lang.Object
-
- one.nio.serial.DataStream
-
- one.nio.serial.ObjectInputChannel
-
- All Implemented Interfaces:
DataInput,DataOutput,ObjectInput,ObjectOutput,AutoCloseable
public class ObjectInputChannel extends DataStream
-
-
Field Summary
-
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(ReadableByteChannel ch)ObjectInputChannel(ReadableByteChannel ch, int bufSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longalloc(int size)voidclose()longgetBytesRead()ObjectreadObject()voidregister(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
-
-
-
-
Constructor Detail
-
ObjectInputChannel
public ObjectInputChannel(ReadableByteChannel ch)
-
ObjectInputChannel
public ObjectInputChannel(ReadableByteChannel ch, int bufSize)
-
-
Method Detail
-
getBytesRead
public long getBytesRead()
-
readObject
public Object readObject() throws IOException, ClassNotFoundException
- Specified by:
readObjectin interfaceObjectInput- Overrides:
readObjectin classDataStream- Throws:
IOExceptionClassNotFoundException
-
reset
public void reset()
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceObjectInput- Specified by:
closein interfaceObjectOutput- Overrides:
closein classDataStream- Throws:
IOException
-
register
public void register(Object obj)
- Overrides:
registerin classDataStream
-
alloc
protected long alloc(int size) throws IOException- Overrides:
allocin classDataStream- Throws:
IOException
-
-