Package org.eclipse.jgit.patch
Class BinaryHunk
java.lang.Object
org.eclipse.jgit.patch.BinaryHunk
Part of a "GIT binary patch" to describe the pre-image or post-image
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Type of information stored in a binary hunk. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]
(package private) int
Position 1 past the end of this hunk withinfile
's buf.private final FileHeader
private int
Inflated length of the data.private static final byte[]
(package private) final int
Offset withinfile
.buf to the "literal" or "delta " line.private BinaryHunk.Type
Type of the data meaning. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Get the byte array holding this hunk's patch script.int
Get offset one past the end of the hunk ingetBuffer()
.Get header for the file this hunk applies to.int
getSize()
Get inflated size of this hunk's data.int
Get offset the start of this hunk ingetBuffer()
.getType()
Get type of this binary hunk.(package private) int
parseHunk
(int ptr, int end)
-
Field Details
-
LITERAL
private static final byte[] LITERAL -
DELTA
private static final byte[] DELTA -
file
-
startOffset
final int startOffsetOffset withinfile
.buf to the "literal" or "delta " line. -
endOffset
int endOffsetPosition 1 past the end of this hunk withinfile
's buf. -
type
Type of the data meaning. -
length
private int lengthInflated length of the data.
-
-
Constructor Details
-
BinaryHunk
BinaryHunk(FileHeader fh, int offset)
-
-
Method Details
-
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
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)
-