Class RpcSocketOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.perforce.p4java.impl.mapbased.rpc.stream.RpcSocketOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class RpcSocketOutputStream extends java.io.OutputStreamImplements the lowest level of the P4Java RPC 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.StringTRACE_PREFIX
-
Constructor Summary
Constructors Constructor Description RpcSocketOutputStream(java.net.Socket socket, ServerStats stats)Construct a suitable stream for the passed-in socket.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.net.SocketgetSocket()protected java.io.OutputStreamgetSocketStream()protected voidsetSocket(java.net.Socket socket)protected voidsetSocketStream(java.io.OutputStream socketStream)voidwrite(byte[] bytes)voidwrite(byte[] bytes, int offset, int len)voidwrite(int b)
-
-
-
Field Detail
-
TRACE_PREFIX
public static final java.lang.String TRACE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RpcSocketOutputStream
public RpcSocketOutputStream(java.net.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 socketstats- stats
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] bytes) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] bytes, int offset, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
getSocket
protected java.net.Socket getSocket()
-
setSocket
protected void setSocket(java.net.Socket socket)
-
getSocketStream
protected java.io.OutputStream getSocketStream()
-
setSocketStream
protected void setSocketStream(java.io.OutputStream socketStream)
-
-