Top Description Fields Constructors Methods
org.eclipse.jgit.lfs.lib

public Class MutableLongObjectId

extends AnyLongObjectId
Class Inheritance
Imports
java.text.MessageFormat, org.eclipse.jgit.lfs.errors.InvalidLongObjectIdException, org.eclipse.jgit.lfs.internal.LfsText, org.eclipse.jgit.util.NB, .RawParseUtils

A mutable SHA-256 abstraction. Ported to SHA-256 from org.eclipse.jgit.lib.MutableObjectId
Since
4.3

Field Summary

Inherited from org.eclipse.jgit.lfs.lib.AnyLongObjectId:
w1w2w3w4

Constructor Summary

AccessConstructor and Description
public
MutableLongObjectId()

Empty constructor.

pack-priv
MutableLongObjectId(MutableLongObjectId
original entry, to copy id from
src
)

Copying constructor.

Method Summary

Modifier and TypeMethod and Description
public void
private void
fromHexString(byte[] bs, int p)

public void
fromObjectId(AnyLongObjectId
the source id to copy from.
src
)

Copy a LongObjectId into this mutable buffer.

public void
fromRaw(byte[]
the raw byte buffer to read from. At least 32 bytes must be available within this byte array.
bs
)

Convert a LongObjectId from raw binary representation.

public void
fromRaw(byte[]
the raw byte buffer to read from. At least 32 bytes after p must be available within this byte array.
bs
,
int
position to read the first byte of data from.
p
)

Convert a LongObjectId from raw binary representation.

public void
fromRaw(long[]
the raw long buffer to read from. At least 4 longs must be available within this longs array.
longs
)

Convert a LongObjectId from binary representation expressed in integers.

public void
fromRaw(long[]
the raw int buffer to read from. At least 4 longs after p must be available within this longs array.
longs
,
int
position to read the first integer of data from.
p
)

Convert a LongObjectId from binary representation expressed in longs.

public void
fromString(byte[]
the US-ASCII buffer to read from. At least 32 bytes after offset must be available within this byte array.
buf
,
int
position to read the first character from.
offset
)

Convert a LongObjectId from hex characters (US-ASCII).

public void
fromString(String
the string to read from. Must be 64 characters long.
str
)

Convert a LongObjectId from hex characters.

private static long
set(long w, int index, long value)

public void
setByte(int
index of the byte to set in the raw form of the ObjectId. Must be in range [0, org.eclipse.jgit.lfs.lib.Constants#LONG_OBJECT_ID_LENGTH).
index
,
int
the value of the specified byte at index. Values are unsigned and thus are in the range [0,255] rather than the signed byte range of [-128, 127].
value
)

Set any byte in the id.

public LongObjectId
toObjectId()

Implements abstract org.eclipse.jgit.lfs.lib.AnyLongObjectId.toObjectId.

Obtain an immutable copy of this current object.

Inherited from org.eclipse.jgit.lfs.lib.AnyLongObjectId:
abbreviatecompareTocompareTocompareTocopycopyRawTocopyRawTocopyRawTocopyRawTocopyTocopyTocopyTocopyTocopyTocopyToequalsequalsformatHexChargetBytegetFirstBytegetNamegetSecondBytehashCodeisEqualnamestartsWithtoHexCharArraytoString

Constructor Detail

MutableLongObjectIdback to summary
public MutableLongObjectId()

Empty constructor. Initialize object with default (zeros) value.

MutableLongObjectIdback to summary
pack-priv MutableLongObjectId(MutableLongObjectId src)

Copying constructor.

Parameters
src:MutableLongObjectId

original entry, to copy id from

Method Detail

clearback to summary
public void clear()

Make this id match org.eclipse.jgit.lfs.lib.LongObjectId#zeroId().

fromHexStringback to summary
private void fromHexString(byte[] bs, int p)
fromObjectIdback to summary
public void fromObjectId(AnyLongObjectId src)

Copy a LongObjectId into this mutable buffer.

Parameters
src:AnyLongObjectId

the source id to copy from.

fromRawback to summary
public void fromRaw(byte[] bs)

Convert a LongObjectId from raw binary representation.

Parameters
bs:byte[]

the raw byte buffer to read from. At least 32 bytes must be available within this byte array.

fromRawback to summary
public void fromRaw(byte[] bs, int p)

Convert a LongObjectId from raw binary representation.

Parameters
bs:byte[]

the raw byte buffer to read from. At least 32 bytes after p must be available within this byte array.

p:int

position to read the first byte of data from.

fromRawback to summary
public void fromRaw(long[] longs)

Convert a LongObjectId from binary representation expressed in integers.

Parameters
longs:long[]

the raw long buffer to read from. At least 4 longs must be available within this longs array.

fromRawback to summary
public void fromRaw(long[] longs, int p)

Convert a LongObjectId from binary representation expressed in longs.

Parameters
longs:long[]

the raw int buffer to read from. At least 4 longs after p must be available within this longs array.

p:int

position to read the first integer of data from.

fromStringback to summary
public void fromString(byte[] buf, int offset)

Convert a LongObjectId from hex characters (US-ASCII).

Parameters
buf:byte[]

the US-ASCII buffer to read from. At least 32 bytes after offset must be available within this byte array.

offset:int

position to read the first character from.

fromStringback to summary
public void fromString(String str)

Convert a LongObjectId from hex characters.

Parameters
str:String

the string to read from. Must be 64 characters long.

setback to summary
private static long set(long w, int index, long value)
setByteback to summary
public void setByte(int index, int value)

Set any byte in the id.

Parameters
index:int

index of the byte to set in the raw form of the ObjectId. Must be in range [0, org.eclipse.jgit.lfs.lib.Constants#LONG_OBJECT_ID_LENGTH).

value:int

the value of the specified byte at index. Values are unsigned and thus are in the range [0,255] rather than the signed byte range of [-128, 127].

Exceptions
ArrayIndexOutOfBoundsException:
index is less than 0, equal to org.eclipse.jgit.lfs.lib.Constants#LONG_OBJECT_ID_LENGTH, or greater than org.eclipse.jgit.lfs.lib.Constants#LONG_OBJECT_ID_LENGTH.
toObjectIdback to summary
public LongObjectId toObjectId()

Implements abstract org.eclipse.jgit.lfs.lib.AnyLongObjectId.toObjectId.

Doc from org.eclipse.jgit.lfs.lib.AnyLongObjectId.toObjectId.

Obtain an immutable copy of this current object.

See copy() if this is a possibly subclassed (but immutable) identity and the application needs a lightweight identity only reference.

Returns:LongObjectId

an immutable copy. May be this if this is already an immutable instance.

Annotations
@Override