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

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

public class RpcRshInputStream
extends InputStream

Implements the lowest level of the P4Java RPC 'rsh' input 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
RpcRshInputStream(InputStream inputstream, ServerStats stats)
          Construct a suitable stream for the passed-in inputstream.
 
Method Summary
 int available()
           
 void close()
           
protected  InputStream getRshStream()
           
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] bytes)
           
 int read(byte[] bytes, int offset, int len)
           
 void reset()
           
protected  void setRshStream(InputStream rshStream)
           
 long skip(long n)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRACE_PREFIX

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

RpcRshInputStream

public RpcRshInputStream(InputStream inputstream,
                         ServerStats stats)
Construct a suitable stream for the passed-in inputstream. No assumptions are made about the passed-in inputstream except that a) it's not null, and b) it's been initialized and set up for reading by the caller.

Parameters:
inputstream - non-null InputStream
stats - non-null ServerStats
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

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException

mark

public void mark(int readlimit)
Overrides:
mark in class InputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
Throws:
IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

toString

public String toString()
Overrides:
toString in class Object

getRshStream

protected InputStream getRshStream()

setRshStream

protected void setRshStream(InputStream rshStream)


Copyright © 2015 Perforce Software. All Rights Reserved.