Class RpcOutputStream

java.lang.Object
java.io.OutputStream
java.io.FileOutputStream
com.perforce.p4java.impl.mapbased.rpc.sys.RpcOutputStream
All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

public class RpcOutputStream extends FileOutputStream
Provides a Perforce-specific extension to the basic Java OuputStream to allow us to intercept methods and implement our own extensions. The two main aims here are for the GKUNZIP file type to stream unzip on the fly, and to do line end processing for text files where needed; everything else is just currently handled in the superclass without real intervention.

Note that for the unzipping we use a contained file output stream rather than ourself, mostly to avoid recursion...

Some of the raw GZUNZIP methods and definitions are copied pretty much as-is from the original gkzip stuff.

The 10.2 sync / transfer integrity checks are basically implemented here, with help from the RpcInflaterOutputStream class. The way this is done is the MD5 hashing has to be done against the incoming 'raw' bytes (i.e. the normalized server-side form of the file) unless the incoming file type is compressed binary, in which case we have to hash the uncompressed version. The non-binary hashing is done here; the compressed stuff is done in RpcInflaterOutputStream.