Top Description Fields Constructors Methods
org.eclipse.jgit.transport

public Class PackedObjectInfo

extends Entry
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.internal.storage.pack.ObjectToPack
Imports
org.eclipse.jgit.lib.AnyObjectId, .Constants, .ObjectIdOwnerMap

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.

Field Summary

Modifier and TypeField and Description
private int
private long
private long
private long
private int

Constructor Summary

AccessConstructor and Description
pack-priv
PackedObjectInfo(final long headerOffset, final int packedCRC, final AnyObjectId id)

public
PackedObjectInfo(AnyObjectId
the identity of the object the new instance tracks.
id
)

Create a new structure to remember information about an object.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the 32 bit CRC checksum for the packed data.
getCRC
()

Get the 32 bit CRC checksum for the packed data.

public long

Returns:

size of the object (inflated, undeltified)
getFullSize
()

Get full size (inflated, undeltified)

public long

Returns:

offset in pack when object has been already written, or 0 if it has not been written yet
getOffset
()

Get offset in pack when object has been already written

pack-priv long

Returns:

size in storage
getSize
()

Size in storage (maybe deflated and/or deltified).

public int

Returns:

the object type. The default type is OBJ_BAD, which is considered as unknown or invalid type.
getType
()

Get the object type.

public void
setCRC(int
checksum of all packed data (including object type code, inflated length and delta base reference) as computed by java.util.zip.CRC32.
crc
)

Record the 32 bit CRC checksum for the packed data.

public void
setFullSize(long
size of the object in bytes, without compressing nor deltifying
size
)

Real (materialized) size of the object (inflated, undeltified)

public void
setOffset(long
offset where written object starts
offset
)

Set the offset in pack when object has been written to.

pack-priv void
setSize(long
size before inflating
sizeBeforeInflating
)

Size in storage

public void
setType(int
the object type.
type
)

Record the object type if applicable.

Field Detail

crcback to summary
private int crc
fullSizeback to summary
private long fullSize
offsetback to summary
private long offset
sizeBeforeInflatingback to summary
private long sizeBeforeInflating
typeback to summary
private int type

Constructor Detail

PackedObjectInfoback to summary
pack-priv PackedObjectInfo(final long headerOffset, final int packedCRC, final AnyObjectId id)
PackedObjectInfoback to summary
public PackedObjectInfo(AnyObjectId id)

Create a new structure to remember information about an object.

Parameters
id:AnyObjectId

the identity of the object the new instance tracks.

Method Detail

getCRCback to summary
public int getCRC()

Get the 32 bit CRC checksum for the packed data.

Returns:int

the 32 bit CRC checksum for the packed data.

getFullSizeback to summary
public long getFullSize()

Get full size (inflated, undeltified)

Returns:long

size of the object (inflated, undeltified)

Since
6.4
getOffsetback to summary
public long getOffset()

Get offset in pack when object has been already written

Returns:long

offset in pack when object has been already written, or 0 if it has not been written yet

getSizeback to summary
pack-priv long getSize()

Size in storage (maybe deflated and/or deltified). This is the size in storage. In packs, this is the bytes used by the object contents (themselves or as deltas) compressed by zlib (deflated).

Returns:long

size in storage

getTypeback to summary
public int getType()

Get the object type.

Returns:int

the object type. The default type is OBJ_BAD, which is considered as unknown or invalid type.

Since
4.9
setCRCback to summary
public void setCRC(int crc)

Record the 32 bit CRC checksum for the packed data.

Parameters
crc:int

checksum of all packed data (including object type code, inflated length and delta base reference) as computed by java.util.zip.CRC32.

setFullSizeback to summary
public void setFullSize(long size)

Real (materialized) size of the object (inflated, undeltified)

Parameters
size:long

size of the object in bytes, without compressing nor deltifying

Since
6.4
setOffsetback to summary
public void setOffset(long offset)

Set the offset in pack when object has been written to.

Parameters
offset:long

offset where written object starts

setSizeback to summary
pack-priv void setSize(long sizeBeforeInflating)

Size in storage

Parameters
sizeBeforeInflating:long

size before inflating

setTypeback to summary
public void setType(int type)

Record the object type if applicable.

Parameters
type:int

the object type.

Since
4.9