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.InputStream
Implements 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.String
TRACE_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.Socket
getSocket()
protected java.io.InputStream
getSockStream()
int
read()
int
read(byte[] bytes)
int
read(byte[] bytes, int offset, int len)
protected void
setSocket(java.net.Socket socket)
protected void
setSockStream(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:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] bytes) throws java.io.IOException
- Overrides:
read
in classjava.io.InputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] bytes, int offset, int len) throws java.io.IOException
- Overrides:
read
in 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)
-
-