Package org.eclipse.jgit.patch
Class BinaryHunk
- java.lang.Object
-
- org.eclipse.jgit.patch.BinaryHunk
-
public class BinaryHunk extends java.lang.Object
Part of a "GIT binary patch" to describe the pre-image or post-image
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BinaryHunk.Type
Type of information stored in a binary hunk.
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
DELTA
(package private) int
endOffset
Position 1 past the end of this hunk withinfile
's buf.private FileHeader
file
private int
length
Inflated length of the data.private static byte[]
LITERAL
(package private) int
startOffset
Offset withinfile
.buf to the "literal" or "delta " line.private BinaryHunk.Type
type
Type of the data meaning.
-
Constructor Summary
Constructors Constructor Description BinaryHunk(FileHeader fh, int offset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBuffer()
Get the byte array holding this hunk's patch script.int
getEndOffset()
Get offset one past the end of the hunk ingetBuffer()
.FileHeader
getFileHeader()
Get header for the file this hunk applies to.int
getSize()
Get inflated size of this hunk's data.int
getStartOffset()
Get offset the start of this hunk ingetBuffer()
.BinaryHunk.Type
getType()
Get type of this binary hunk.(package private) int
parseHunk(int ptr, int end)
-
-
-
Field Detail
-
LITERAL
private static final byte[] LITERAL
-
DELTA
private static final byte[] DELTA
-
file
private final FileHeader file
-
startOffset
final int startOffset
Offset withinfile
.buf to the "literal" or "delta " line.
-
endOffset
int endOffset
Position 1 past the end of this hunk withinfile
's buf.
-
type
private BinaryHunk.Type type
Type of the data meaning.
-
length
private int length
Inflated length of the data.
-
-
Constructor Detail
-
BinaryHunk
BinaryHunk(FileHeader fh, int offset)
-
-
Method Detail
-
getFileHeader
public FileHeader getFileHeader()
Get header for the file this hunk applies to.- Returns:
- header for the file this hunk applies to.
-
getBuffer
public byte[] getBuffer()
Get the byte array holding this hunk's patch script.- Returns:
- the byte array holding this hunk's patch script.
-
getStartOffset
public int getStartOffset()
Get offset the start of this hunk ingetBuffer()
.- Returns:
- offset the start of this hunk in
getBuffer()
.
-
getEndOffset
public int getEndOffset()
Get offset one past the end of the hunk ingetBuffer()
.- Returns:
- offset one past the end of the hunk in
getBuffer()
.
-
getType
public BinaryHunk.Type getType()
Get type of this binary hunk.- Returns:
- type of this binary hunk.
-
getSize
public int getSize()
Get inflated size of this hunk's data.- Returns:
- inflated size of this hunk's data.
-
parseHunk
int parseHunk(int ptr, int end)
-
-