Class RpcSocketInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.perforce.p4java.impl.mapbased.rpc.stream.RpcSocketInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class RpcSocketInputStream extends java.io.InputStreamImplements the lowest level of the P4Java RPC input socket stream architecture.This class does the most basic conversion from incoming bytes on the (TCP/IP) wire to a Java IO input stream whose contents are further decoded upstream.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTRACE_PREFIX
-
Constructor Summary
Constructors Constructor Description RpcSocketInputStream(java.net.Socket socket, ServerStats stats)Construct a suitable stream for the passed-in socket.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.net.SocketgetSocket()protected java.io.InputStreamgetSockStream()intread()intread(byte[] bytes)intread(byte[] bytes, int offset, int len)protected voidsetSocket(java.net.Socket socket)protected voidsetSockStream(java.io.InputStream sockStream)
-
-
-
Field Detail
-
TRACE_PREFIX
public static final java.lang.String TRACE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RpcSocketInputStream
public RpcSocketInputStream(java.net.Socket socket, ServerStats stats)Construct a suitable stream for the passed-in socket. No assumptions are made about the passed-in socket except that a) it's not null, and b) it's been initialized and set up for reading (or at least the successful retrieval of a suitable input stream) by the caller.- Parameters:
socket- non-null socketstats- stats
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] bytes) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] bytes, int offset, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
getSocket
protected java.net.Socket getSocket()
-
setSocket
protected void setSocket(java.net.Socket socket)
-
getSockStream
protected java.io.InputStream getSockStream()
-
setSockStream
protected void setSockStream(java.io.InputStream sockStream)
-
-