public class RpcOutputStream extends 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) |
RpcOutputStream(RpcPerforceFile file,
boolean useLocalDigester) |
RpcOutputStream(RpcPerforceFile file,
Charset charset,
boolean isUnicodeServer,
boolean useLocalDigester) |
Modifier and Type | Method and Description |
---|---|
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.
|
finalize, getChannel, getFD
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
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
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, FileDecoderException, FileEncoderException
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, FileDecoderException, FileEncoderException
sourceBytes
- IOException
FileEncoderException
FileDecoderException
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)
Copyright © 2017 Perforce Software. All Rights Reserved.