Package one.nio.rpc.stream
Class RpcStreamImpl<S,R>
java.lang.Object
one.nio.rpc.stream.RpcStreamImpl<S,R>
- All Implemented Interfaces:
DataInput,DataOutput,ObjectInput,ObjectOutput,AutoCloseable,BaseStream,BidiStream<S,,R> ReceiveStream<R>,RpcStream,SendStream<S>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final ObjectInputChannelprotected final ObjectOutputChannelprotected final Socket -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()voidflush()longlongvoidintread()intread(byte[] b) intread(byte[] b, int off, int len) voidread(ByteBuffer buf) booleanbytereadByte()charreadChar()doublefloatvoidreadFully(byte[] b) voidreadFully(byte[] b, int off, int len) intreadInt()readLine()longreadLong()shortintintreadUTF()receive()voidsendAndGet(S object) longskip(long n) intskipBytes(int n) socket()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwrite(ByteBuffer buf) voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) voidwriteChar(int v) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidwriteObject(Object obj) voidwriteShort(int v) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.nio.rpc.stream.BaseStream
getLocalAddress, getRemoteAddress
-
Field Details
-
socket
-
in
-
out
-
error
protected boolean error
-
-
Constructor Details
-
RpcStreamImpl
-
-
Method Details
-
socket
- Specified by:
socketin interfaceBaseStream
-
getBytesRead
public long getBytesRead()- Specified by:
getBytesReadin interfaceBaseStream
-
getBytesWritten
public long getBytesWritten()- Specified by:
getBytesWrittenin interfaceBaseStream
-
invalidate
public void invalidate()- Specified by:
invalidatein interfaceBaseStream
-
read
- Specified by:
readin interfaceRpcStream- Throws:
IOException
-
readObject
- Specified by:
readObjectin interfaceObjectInput- Throws:
IOExceptionClassNotFoundException
-
read
- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
read
- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
skip
- Specified by:
skipin interfaceObjectInput- Throws:
IOException
-
available
public int available()- Specified by:
availablein interfaceObjectInput
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- 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
-
write
- Specified by:
writein interfaceRpcStream- Throws:
IOException
-
writeObject
- Specified by:
writeObjectin 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
-
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
-
flush
- Specified by:
flushin interfaceBidiStream<S,R> - Specified by:
flushin interfaceObjectOutput- Throws:
IOException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStream- Specified by:
closein interfaceObjectInput- Specified by:
closein interfaceObjectOutput
-
receive
- Specified by:
receivein interfaceReceiveStream<S>- Throws:
IOExceptionClassNotFoundException
-
send
- Specified by:
sendin interfaceSendStream<S>- Throws:
IOException
-
sendAndGet
- Specified by:
sendAndGetin interfaceBidiStream<S,R> - Throws:
IOExceptionClassNotFoundException
-