Package org.eclipse.jgit.transport
Class PackedObjectInfo
java.lang.Object
org.eclipse.jgit.lib.AnyObjectId
org.eclipse.jgit.lib.ObjectId
org.eclipse.jgit.lib.ObjectIdOwnerMap.Entry
org.eclipse.jgit.transport.PackedObjectInfo
- All Implemented Interfaces:
Serializable
,Comparable<AnyObjectId>
- Direct Known Subclasses:
ObjectToPack
Description of an object stored in a pack file, including offset.
When objects are stored in packs Git needs the ObjectId and the offset (starting position of the object data) to perform random-access reads of objects from the pack. This extension of ObjectId includes the offset.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private long
private long
private int
-
Constructor Summary
ConstructorsConstructorDescriptionPackedObjectInfo
(long headerOffset, int packedCRC, AnyObjectId id) Create a new structure to remember information about an object. -
Method Summary
Modifier and TypeMethodDescriptionint
getCRC()
Get the 32 bit CRC checksum for the packed data.long
Get offset in pack when object has been already written(package private) long
getSize()
int
getType()
Get the object type.void
setCRC
(int crc) Record the 32 bit CRC checksum for the packed data.void
setOffset
(long offset) Set the offset in pack when object has been written to.(package private) void
setSize
(long sizeBeforeInflating) void
setType
(int type) Record the object type if applicable.Methods inherited from class org.eclipse.jgit.lib.ObjectId
equals, fromRaw, fromRaw, fromRaw, fromRaw, fromString, fromString, isId, toObjectId, toString, zeroId
Methods inherited from class org.eclipse.jgit.lib.AnyObjectId
abbreviate, compareTo, compareTo, compareTo, copy, copyRawTo, copyRawTo, copyRawTo, copyRawTo, copyTo, copyTo, copyTo, copyTo, copyTo, copyTo, equals, equals, equals, getByte, getFirstByte, getName, hashCode, isEqual, name, startsWith, toString
-
Field Details
-
offset
private long offset -
crc
private int crc -
type
private int type -
sizeBeforeInflating
private long sizeBeforeInflating
-
-
Constructor Details
-
PackedObjectInfo
PackedObjectInfo(long headerOffset, int packedCRC, AnyObjectId id) -
PackedObjectInfo
Create a new structure to remember information about an object.- Parameters:
id
- the identity of the object the new instance tracks.
-
-
Method Details
-
getOffset
public long getOffset()Get offset in pack when object has been already written- Returns:
- offset in pack when object has been already written, or 0 if it has not been written yet
-
setOffset
public void setOffset(long offset) Set the offset in pack when object has been written to.- Parameters:
offset
- offset where written object starts
-
getCRC
public int getCRC()Get the 32 bit CRC checksum for the packed data.- Returns:
- the 32 bit CRC checksum for the packed data.
-
setCRC
public void setCRC(int crc) Record the 32 bit CRC checksum for the packed data.- Parameters:
crc
- checksum of all packed data (including object type code, inflated length and delta base reference) as computed byCRC32
.
-
getType
public int getType()Get the object type.- Returns:
- the object type. The default type is OBJ_BAD, which is considered as unknown or invalid type.
- Since:
- 4.9
-
setType
public void setType(int type) Record the object type if applicable.- Parameters:
type
- the object type.- Since:
- 4.9
-
setSize
void setSize(long sizeBeforeInflating) -
getSize
long getSize()
-