com.perforce.p4java.impl.mapbased.rpc.stream
Class RpcSocketInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.perforce.p4java.impl.mapbased.rpc.stream.RpcSocketInputStream
All Implemented Interfaces:
Closeable

public class RpcSocketInputStream
extends 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
static String TRACE_PREFIX
           
 
Constructor Summary
RpcSocketInputStream(Socket socket, ServerStats stats)
          Construct a suitable stream for the passed-in socket.
 
Method Summary
protected  Socket getSocket()
           
protected  InputStream getSockStream()
           
 int read()
           
 int read(byte[] bytes)
           
 int read(byte[] bytes, int offset, int len)
           
protected  void setSocket(Socket socket)
           
protected  void setSockStream(InputStream sockStream)
           
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE_PREFIX

public static final String TRACE_PREFIX
See Also:
Constant Field Values
Constructor Detail

RpcSocketInputStream

public RpcSocketInputStream(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 socket
Method Detail

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] bytes)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] bytes,
                int offset,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

getSocket

protected Socket getSocket()

setSocket

protected void setSocket(Socket socket)

getSockStream

protected InputStream getSockStream()

setSockStream

protected void setSockStream(InputStream sockStream)


Copyright © 2015 Perforce Software. All Rights Reserved.