Package one.nio.rpc.stream
Class StreamProxy<S,R>
- java.lang.Object
-
- one.nio.rpc.stream.StreamProxy<S,R>
-
- All Implemented Interfaces:
DataInput,DataOutput,ObjectInput,ObjectOutput,AutoCloseable,BaseStream,BidiStream<S,R>,ReceiveStream<R>,RpcStream,SendStream<S>
public final class StreamProxy<S,R> extends Object implements RpcStream, BidiStream<S,R>
-
-
Field Summary
Fields Modifier and Type Field Description longbytesReadlongbytesWrittenStreamHandlerhandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidflush()longgetBytesRead()longgetBytesWritten()InetSocketAddressgetLocalAddress()InetSocketAddressgetRemoteAddress()voidinvalidate()intread()intread(byte[] b)intread(byte[] b, int off, int len)voidread(ByteBuffer buf)booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()floatreadFloat()voidreadFully(byte[] b)voidreadFully(byte[] b, int off, int len)intreadInt()StringreadLine()longreadLong()ObjectreadObject()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()Rreceive()voidsend(S object)RsendAndGet(S object)longskip(long n)intskipBytes(int n)Socketsocket()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)voidwriteUTF(String s)
-
-
-
Field Detail
-
handler
public final StreamHandler handler
-
bytesRead
public long bytesRead
-
bytesWritten
public long bytesWritten
-
-
Method Detail
-
socket
public final Socket socket()
- Specified by:
socketin interfaceBaseStream
-
getLocalAddress
public final InetSocketAddress getLocalAddress()
- Specified by:
getLocalAddressin interfaceBaseStream
-
getRemoteAddress
public final InetSocketAddress getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceBaseStream
-
getBytesRead
public final long getBytesRead()
- Specified by:
getBytesReadin interfaceBaseStream
-
getBytesWritten
public final long getBytesWritten()
- Specified by:
getBytesWrittenin interfaceBaseStream
-
invalidate
public final void invalidate()
- Specified by:
invalidatein interfaceBaseStream
-
read
public final void read(ByteBuffer buf) throws IOException
- Specified by:
readin interfaceRpcStream- Throws:
IOException
-
readObject
public final Object readObject() throws IOException
- Specified by:
readObjectin interfaceObjectInput- Throws:
IOException
-
read
public final int read() throws IOException- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
read
public final int read(byte[] b) throws IOException- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
read
public final int read(byte[] b, int off, int len) throws IOException- Specified by:
readin interfaceObjectInput- Throws:
IOException
-
skip
public final long skip(long n) throws IOException- Specified by:
skipin interfaceObjectInput- Throws:
IOException
-
available
public final int available()
- Specified by:
availablein interfaceObjectInput
-
readFully
public final void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public final void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
public final int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readBoolean
public final boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
public final byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public final int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
public final short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public final int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
public final char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
public final int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
public final long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
public final float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
public final double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readLine
public final String readLine() throws IOException
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
public final String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
write
public final void write(ByteBuffer buf) throws IOException
- Specified by:
writein interfaceRpcStream- Throws:
IOException
-
writeObject
public final void writeObject(Object obj) throws IOException
- Specified by:
writeObjectin interfaceObjectOutput- Throws:
IOException
-
write
public final void write(int b) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
write
public final void write(byte[] b) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
write
public final void write(byte[] b, int off, int len) throws IOException- Specified by:
writein interfaceDataOutput- Specified by:
writein interfaceObjectOutput- Throws:
IOException
-
writeBoolean
public final void writeBoolean(boolean v) throws IOException- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
public final void writeByte(int v) throws IOException- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeShort
public final void writeShort(int v) throws IOException- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeChar
public final void writeChar(int v) throws IOException- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeInt
public final void writeInt(int v) throws IOException- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
public final void writeLong(long v) throws IOException- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeFloat
public final void writeFloat(float v) throws IOException- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeDouble
public final void writeDouble(double v) throws IOException- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeBytes
public final void writeBytes(String s) throws IOException
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChars
public final void writeChars(String s) throws IOException
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeUTF
public final void writeUTF(String s) throws IOException
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
flush
public final void flush() throws IOException- Specified by:
flushin interfaceBidiStream<S,R>- Specified by:
flushin interfaceObjectOutput- Throws:
IOException
-
close
public final void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStream- Specified by:
closein interfaceObjectInput- Specified by:
closein interfaceObjectOutput
-
receive
public final R receive() throws IOException
- Specified by:
receivein interfaceReceiveStream<S>- Throws:
IOException
-
send
public final void send(S object) throws IOException
- Specified by:
sendin interfaceSendStream<S>- Throws:
IOException
-
sendAndGet
public final R sendAndGet(S object) throws IOException
- Specified by:
sendAndGetin interfaceBidiStream<S,R>- Throws:
IOException
-
-