Top Description Inners Fields Constructors Methods
org.eclipse.jgit.patch

public Class BinaryHunk

extends Object
Class Inheritance
Static Imports
org.eclipse.jgit.lib.Constants.encodeASCII, org.eclipse.jgit.util.RawParseUtils.match, .RawParseUtils.nextLF, .RawParseUtils.parseBase10

Part of a "GIT binary patch" to describe the pre-image or post-image

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
BinaryHunk.Type

Type of information stored in a binary hunk.

Field Summary

Modifier and TypeField and Description
private static final byte[]
pack-priv int
endOffset

Position 1 past the end of this hunk within file's buf.

private final FileHeader
private int
length

Inflated length of the data.

private static final byte[]
pack-priv final int
startOffset

Offset within file.buf to the "literal" or "delta " line.

private BinaryHunk.Type
type

Type of the data meaning.

Constructor Summary

AccessConstructor and Description
pack-priv
BinaryHunk(FileHeader fh, int offset)

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

the byte array holding this hunk's patch script.
getBuffer
()

Get the byte array holding this hunk's patch script.

public int

Returns:

offset one past the end of the hunk in getBuffer().
getEndOffset
()

Get offset one past the end of the hunk in getBuffer().

public FileHeader

Returns:

header for the file this hunk applies to.
getFileHeader
()

Get header for the file this hunk applies to.

public int

Returns:

inflated size of this hunk's data.
getSize
()

Get inflated size of this hunk's data.

public int

Returns:

offset the start of this hunk in getBuffer().
getStartOffset
()

Get offset the start of this hunk in getBuffer().

public BinaryHunk.Type

Returns:

type of this binary hunk.
getType
()

Get type of this binary hunk.

pack-priv int
parseHunk(int ptr, int end)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DELTAback to summary
private static final byte[] DELTA
endOffsetback to summary
pack-priv int endOffset

Position 1 past the end of this hunk within file's buf.

fileback to summary
private final FileHeader file
lengthback to summary
private int length

Inflated length of the data.

LITERALback to summary
private static final byte[] LITERAL
startOffsetback to summary
pack-priv final int startOffset

Offset within file.buf to the "literal" or "delta " line.

typeback to summary
private BinaryHunk.Type type

Type of the data meaning.

Constructor Detail

BinaryHunkback to summary
pack-priv BinaryHunk(FileHeader fh, int offset)

Method Detail

getBufferback to summary
public byte[] getBuffer()

Get the byte array holding this hunk's patch script.

Returns:byte[]

the byte array holding this hunk's patch script.

getEndOffsetback to summary
public int getEndOffset()

Get offset one past the end of the hunk in getBuffer().

Returns:int

offset one past the end of the hunk in getBuffer().

getFileHeaderback to summary
public FileHeader getFileHeader()

Get header for the file this hunk applies to.

Returns:FileHeader

header for the file this hunk applies to.

getSizeback to summary
public int getSize()

Get inflated size of this hunk's data.

Returns:int

inflated size of this hunk's data.

getStartOffsetback to summary
public int getStartOffset()

Get offset the start of this hunk in getBuffer().

Returns:int

offset the start of this hunk in getBuffer().

getTypeback to summary
public BinaryHunk.Type getType()

Get type of this binary hunk.

Returns:BinaryHunk.Type

type of this binary hunk.

parseHunkback to summary
pack-priv int parseHunk(int ptr, int end)
org.eclipse.jgit.patch back to summary

public final Enum BinaryHunk.Type

extends Enum<BinaryHunk.Type>
Class Inheritance

Type of information stored in a binary hunk.

Field Summary

Modifier and TypeField and Description
public static final BinaryHunk.Type
DELTA_DEFLATED

A Git pack-style delta is stored, deflated.

public static final BinaryHunk.Type
LITERAL_DEFLATED

The full content is stored, deflated.

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public static BinaryHunk.Type
public static BinaryHunk.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DELTA_DEFLATEDback to summary
public static final BinaryHunk.Type DELTA_DEFLATED

A Git pack-style delta is stored, deflated.

LITERAL_DEFLATEDback to summary
public static final BinaryHunk.Type LITERAL_DEFLATED

The full content is stored, deflated.

Constructor Detail

Typeback to summary
private Type()

Method Detail

valueOfback to summary
public static BinaryHunk.Type valueOf(String name)
valuesback to summary
public static BinaryHunk.Type[] values()