public class RpcOutputStream
extends java.io.FileOutputStream
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 and Description |
---|
RpcOutputStream(RpcPerforceFile file,
RpcConnection rpcConnection,
boolean useLocalDigester) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
RpcPerforceFile |
getFile() |
MD5Digester |
getLocalDigester() |
java.lang.String |
getServerDigest() |
static RpcOutputStream |
getTmpOutputStream(RpcPerforceFile file) |
void |
setLocalDigester(MD5Digester localDigester) |
void |
setServerDigest(java.lang.String serverDigest) |
void |
write(byte[] b) |
void |
write(byte[] sourceBytes,
int off,
int len) |
void |
write(int b) |
long |
write(java.util.Map<java.lang.String,java.lang.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.
|
public RpcOutputStream(RpcPerforceFile file, RpcConnection rpcConnection, boolean useLocalDigester) throws java.io.IOException
java.io.IOException
public static RpcOutputStream getTmpOutputStream(RpcPerforceFile file) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FileOutputStream
java.io.IOException
public long write(java.util.Map<java.lang.String,java.lang.Object> map) throws java.io.IOException, FileDecoderException, FileEncoderException
map
- mapFileEncoderException
- on errorFileDecoderException
- on errorjava.io.IOException
- on errorpublic void write(byte[] sourceBytes, int off, int len) throws java.io.IOException
write
in class java.io.FileOutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.FileOutputStream
java.io.IOException
public long writeConverted(byte[] sourceBytes) throws java.io.IOException, FileDecoderException, FileEncoderException
sourceBytes
- sourceBytesjava.io.IOException
- on errorFileEncoderException
- on errorFileDecoderException
- on errorpublic void write(int b) throws java.io.IOException
write
in class java.io.FileOutputStream
java.io.IOException
public RpcPerforceFile getFile()
public java.lang.String getServerDigest()
public void setServerDigest(java.lang.String serverDigest)
public MD5Digester getLocalDigester()
public void setLocalDigester(MD5Digester localDigester)