Package org.tmatesoft.svn.core.io.diff
Class SVNDiffWindowApplyBaton
- java.lang.Object
-
- org.tmatesoft.svn.core.io.diff.SVNDiffWindowApplyBaton
-
public class SVNDiffWindowApplyBaton extends java.lang.Object
The SVNDiffWindowApplyBaton class is used to provide the source and target streams during applying diff windows. Also an instance of SVNDiffWindowApplyBaton may be supplied with an MD5 digest object for on-the-fly updating it with the bytes of the target view. So that when a diff window's instructions are applied, the digest will be the checksum for the full expanded text written to the target stream during delta application.- Since:
- 1.2
- Version:
- 1.3
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.security.MessageDigest
myDigest
(package private) byte[]
mySourceBuffer
(package private) java.io.InputStream
mySourceStream
(package private) int
mySourceViewLength
(package private) long
mySourceViewOffset
(package private) byte[]
myTargetBuffer
(package private) java.io.OutputStream
myTargetStream
(package private) int
myTargetViewSize
-
Constructor Summary
Constructors Modifier Constructor Description private
SVNDiffWindowApplyBaton()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
close()
Closes the source and target streams, finalizes the checksum computation and returns it in a hex representation.static SVNDiffWindowApplyBaton
create(java.io.File source, java.io.File target, java.security.MessageDigest digest)
Creates a diff window apply baton whith source and target streams represented by files.static SVNDiffWindowApplyBaton
create(java.io.InputStream source, java.io.OutputStream target, java.security.MessageDigest digest)
Creates a diff window apply baton whith initial source and target streams.
-
-
-
Field Detail
-
mySourceStream
java.io.InputStream mySourceStream
-
myTargetStream
java.io.OutputStream myTargetStream
-
mySourceViewOffset
long mySourceViewOffset
-
mySourceViewLength
int mySourceViewLength
-
myTargetViewSize
int myTargetViewSize
-
mySourceBuffer
byte[] mySourceBuffer
-
myTargetBuffer
byte[] myTargetBuffer
-
myDigest
java.security.MessageDigest myDigest
-
-
Method Detail
-
create
public static SVNDiffWindowApplyBaton create(java.io.File source, java.io.File target, java.security.MessageDigest digest) throws SVNException
Creates a diff window apply baton whith source and target streams represented by files.- Parameters:
source
- a source file (from where the source views would be taken)target
- a target file where the full text is writtendigest
- an MD5 checksum for the full text that would be updated after each instruction applying- Returns:
- a new SVNDiffWindowApplyBaton object
- Throws:
SVNException
-
create
public static SVNDiffWindowApplyBaton create(java.io.InputStream source, java.io.OutputStream target, java.security.MessageDigest digest)
Creates a diff window apply baton whith initial source and target streams.- Parameters:
source
- a source input stream (from where the source views would be taken)target
- a target output stream where the full text is writtendigest
- an MD5 checksum for the full text that would be updated after each instruction applying- Returns:
- a new SVNDiffWindowApplyBaton object
-
close
public java.lang.String close()
Closes the source and target streams, finalizes the checksum computation and returns it in a hex representation.- Returns:
- an MD5 checksum in a hex representation.
-
-