Top Description Fields Constructors Methods
org.eclipse.jgit.internal.storage.file

pack-priv final Class UInt24Array

extends Object
Class Inheritance

A view of a byte[] as a list of integers stored in 3 bytes. The ints are stored in big-endian ("network order"), so byte[]{aa,bb,cc} becomes the int 0x00aabbcc

Field Summary

Modifier and TypeField and Description
private final byte[]
public static final UInt24Array
private static final int
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
UInt24Array(byte[] data)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

position of the needle in the array, -1 if not found. Runtime exception if the value is too big for 3 bytes.
binarySearch
(int
It cannot be bigger than 0xffffff (max unsigned three bytes).
needle
)

Search needle in the array.

pack-priv int
get(int index)

pack-priv int
pack-priv boolean
pack-priv int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private final byte[] data
EMPTYback to summary
public static final UInt24Array EMPTY
ENTRY_SZback to summary
private static final int ENTRY_SZ
sizeback to summary
private final int size

Constructor Detail

UInt24Arrayback to summary
pack-priv UInt24Array(byte[] data)

Method Detail

binarySearchback to summary
pack-priv int binarySearch(int needle)

Search needle in the array. This assumes a sorted array.

Parameters
needle:int

It cannot be bigger than 0xffffff (max unsigned three bytes).

Returns:int

position of the needle in the array, -1 if not found. Runtime exception if the value is too big for 3 bytes.

getback to summary
pack-priv int get(int index)
getLastValueback to summary
pack-priv int getLastValue()
isEmptyback to summary
pack-priv boolean isEmpty()
sizeback to summary
pack-priv int size()