Package one.nio.serial
Class DataStream
java.lang.Object
one.nio.serial.DataStream
- All Implemented Interfaces:
DataInput,DataOutput,ObjectInput,ObjectOutput,AutoCloseable
- Direct Known Subclasses:
DeserializeStream,ObjectInputChannel,ObjectOutputChannel,SerializerCollector,SerializeStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected byte[]protected static final byteprotected longprotected longprotected static final byteprotected static final byteprotected static final byteprotected static final byte -
Constructor Summary
ConstructorsModifierConstructorDescriptionDataStream(byte[] array) protectedDataStream(byte[] array, long address, long length) DataStream(int capacity) DataStream(long address, long length) -
Method Summary
Modifier and TypeMethodDescriptionlongaddress()protected longalloc(int size) byte[]array()intbyteBuffer(int len) voidclose()intcount()voidflush()newScope()intread()intread(byte[] b) intread(byte[] b, int off, int len) voidread(ByteBuffer dst) booleanbytereadByte()charreadChar()doublefloatvoidreadFully(byte[] b) voidreadFully(byte[] b, int off, int len) intreadInt()readLine()longreadLong()protected ObjectreadRef(byte tag) shortvoidreadTo(long address, int len) intintreadUTF()voidlongskip(long n) intskipBytes(int n) voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwrite(ByteBuffer src) voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) voidwriteChar(int v) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteFrom(long address, int len) voidwriteInt(int v) voidwriteLong(long v) voidwriteObject(Object obj) voidwriteShort(int v) void
-
Field Details
-
REF_NULL
protected static final byte REF_NULL- See Also:
-
REF_RECURSIVE
protected static final byte REF_RECURSIVE- See Also:
-
REF_RECURSIVE2
protected static final byte REF_RECURSIVE2- See Also:
-
REF_EMBEDDED
protected static final byte REF_EMBEDDED- See Also:
-
FIRST_BOOT_UID
protected static final byte FIRST_BOOT_UID- See Also:
-
array
protected byte[] array -
address
protected long address -
limit
protected long limit -
offset
protected long offset
-
-
Constructor Details
-
DataStream
public DataStream(int capacity) -
DataStream
public DataStream(byte[] array) -
DataStream
public DataStream(long address, long length) -
DataStream
protected DataStream(byte[] array, long address, long length)
-
-
Method Details
-
array
public byte[] array() -
address
public long address() -
count
public int count() -
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
writeObject
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
write
- Throws:
IOException
-
writeFrom
- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skip
- Specified by:
skipin interfaceObjectInput- Throws:
IOException
-
skipBytes
- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
readObject
- Specified by:
readObjectin interfaceObjectInput- Throws:
IOExceptionClassNotFoundException
-
readRef
- Throws:
IOExceptionClassNotFoundException
-
read
- Throws:
IOException
-
readTo
- Throws:
IOException
-
byteBuffer
- Throws:
IOException
-
available
public int available()- Specified by:
availablein interfaceObjectInput
-
flush
- Specified by:
flushin interfaceObjectOutput- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceObjectInput- Specified by:
closein interfaceObjectOutput- Throws:
IOException
-
register
-
newScope
-
alloc
- Throws:
IOException
-