Class RpcRshOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.perforce.p4java.impl.mapbased.rpc.stream.RpcRshOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
public class RpcRshOutputStream extends java.io.OutputStream
Implements the lowest level of the P4Java RPC 'rsh' output stream architecture.This class does the most basic conversion of outgoing bytes to the (TCP/IP) wire from a Java IO output stream whose contents have been encoded upstream.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TRACE_PREFIX
-
Constructor Summary
Constructors Constructor Description RpcRshOutputStream(java.io.OutputStream outputstream, ServerStats stats)
Construct a suitable stream for the passed-in inputstream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
protected java.io.OutputStream
getRshStream()
protected void
setRshStream(java.io.OutputStream rshStream)
java.lang.String
toString()
void
write(byte[] bytes)
void
write(byte[] bytes, int offset, int len)
void
write(int b)
-
-
-
Field Detail
-
TRACE_PREFIX
public static final java.lang.String TRACE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RpcRshOutputStream
public RpcRshOutputStream(java.io.OutputStream outputstream, 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:
outputstream
- non-null OutputStreamstats
- non-null ServerStats
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] bytes) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] bytes, int offset, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- 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.OutputStream
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getRshStream
protected java.io.OutputStream getRshStream()
-
setRshStream
protected void setRshStream(java.io.OutputStream rshStream)
-
-