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

java.lang.Object
  extended by java.io.OutputStream
      extended by com.perforce.p4java.impl.mapbased.rpc.stream.RpcRshOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class RpcRshOutputStream
extends 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
static String TRACE_PREFIX
           
 
Constructor Summary
RpcRshOutputStream(OutputStream outputstream, ServerStats stats)
          Construct a suitable stream for the passed-in inputstream.
 
Method Summary
 void close()
           
 void flush()
           
protected  OutputStream getRshStream()
           
protected  void setRshStream(OutputStream rshStream)
           
 String toString()
           
 void write(byte[] bytes)
           
 void write(byte[] bytes, int offset, int len)
           
 void write(int b)
           
 
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

RpcRshOutputStream

public RpcRshOutputStream(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 OutputStream
stats - non-null ServerStats
Method Detail

write

public void write(int b)
           throws IOException
Specified by:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] bytes)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

write

public void write(byte[] bytes,
                  int offset,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

close

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

toString

public String toString()
Overrides:
toString in class Object

getRshStream

protected OutputStream getRshStream()

setRshStream

protected void setRshStream(OutputStream rshStream)


Copyright © 2015 Perforce Software. All Rights Reserved.