|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FileOutputStream
com.perforce.p4java.impl.mapbased.rpc.sys.RpcOutputStream
public class RpcOutputStream
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.
Constructor Summary | |
---|---|
RpcOutputStream(RpcPerforceFile file)
|
|
RpcOutputStream(RpcPerforceFile file,
boolean useLocalDigester)
|
|
RpcOutputStream(RpcPerforceFile file,
Charset charset,
boolean isUnicodeServer,
boolean useLocalDigester)
|
Method Summary | |
---|---|
void |
close()
|
void |
flush()
|
RpcPerforceFile |
getFile()
|
MD5Digester |
getLocalDigester()
|
String |
getServerDigest()
|
void |
setLocalDigester(MD5Digester localDigester)
|
void |
setServerDigest(String serverDigest)
|
void |
write(byte[] b)
|
void |
write(byte[] sourceBytes,
int off,
int len)
|
void |
write(int b)
|
long |
write(Map<String,Object> map)
Specialized write method to write a map containing a byte array with the key RpcFunctionMapKey.DATA (all other fields are ignored). |
long |
writeConverted(byte[] sourceBytes)
Write an array of bytes with being aware of encodings, line ending conversions, and compression. |
Methods inherited from class java.io.FileOutputStream |
---|
finalize, getChannel, getFD |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RpcOutputStream(RpcPerforceFile file) throws IOException
IOException
public RpcOutputStream(RpcPerforceFile file, boolean useLocalDigester) throws IOException
IOException
public RpcOutputStream(RpcPerforceFile file, Charset charset, boolean isUnicodeServer, boolean useLocalDigester) throws IOException
IOException
Method Detail |
---|
public void close() throws IOException
close
in interface Closeable
close
in class FileOutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
OutputStream.flush()
public long write(Map<String,Object> map) throws IOException
IOException
public void write(byte[] sourceBytes, int off, int len) throws IOException
write
in class FileOutputStream
IOException
public void write(byte[] b) throws IOException
write
in class FileOutputStream
IOException
public long writeConverted(byte[] sourceBytes) throws IOException
sourceBytes
-
IOException
public void write(int b) throws IOException
write
in class FileOutputStream
IOException
public RpcPerforceFile getFile()
public String getServerDigest()
public void setServerDigest(String serverDigest)
public MD5Digester getLocalDigester()
public void setLocalDigester(MD5Digester localDigester)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |