Class RpcRshInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.perforce.p4java.impl.mapbased.rpc.stream.RpcRshInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class RpcRshInputStream extends java.io.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
Fields Modifier and Type Field Description static java.lang.String
TRACE_PREFIX
-
Constructor Summary
Constructors Constructor Description RpcRshInputStream(java.io.InputStream inputstream, ServerStats stats)
Construct a suitable stream for the passed-in inputstream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
protected java.io.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(java.io.InputStream rshStream)
long
skip(long n)
java.lang.String
toString()
-
-
-
Field Detail
-
TRACE_PREFIX
public static final java.lang.String TRACE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RpcRshInputStream
public RpcRshInputStream(java.io.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 InputStreamstats
- non-null ServerStats
-
-
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
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.InputStream
- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Overrides:
mark
in classjava.io.InputStream
-
reset
public void reset() throws java.io.IOException
- Overrides:
reset
in classjava.io.InputStream
- Throws:
java.io.IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classjava.io.InputStream
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getRshStream
protected java.io.InputStream getRshStream()
-
setRshStream
protected void setRshStream(java.io.InputStream rshStream)
-
-