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

pack-priv final Class PackReverseIndexWriterV1

extends PackReverseIndexWriter
Class Inheritance
Static Imports
org.eclipse.jgit.internal.storage.file.PackReverseIndex.MAGIC, .PackReverseIndex.VERSION_1, .PackReverseIndexV1.OID_VERSION_SHA1

Writes reverse index files following the version 1 format.

The file format is specified at https://git-scm.com/docs/pack-format#_pack_rev_files_have_the_format.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final int
Inherited from org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter:
dataOutputout

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
writeBody(List<? extends PackedObjectInfo>
the objects whose forward index file positions should be written, sorted by forward index file position; not modified during method
objectsByIndexPos
)

Implements abstract org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter.writeBody.

Write the body of a reverse index file, usually the forward index positions of the given objects, sorted by those objects' pack file offsets.

protected void
writeHeader()

Implements abstract org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter.writeHeader.

Write the header of a reverse index file, usually the magic bytes and the file format version.

Inherited from org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter:
createWritercreateWriterwrite

Field Detail

DEFAULT_OID_VERSIONback to summary
private static final int DEFAULT_OID_VERSION

Constructor Detail

PackReverseIndexWriterV1back to summary
pack-priv PackReverseIndexWriterV1(final OutputStream dst)

Method Detail

writeBodyback to summary
protected void writeBody(List<? extends PackedObjectInfo> objectsByIndexPos) throws IOException

Implements abstract org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter.writeBody.

Doc from org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter.writeBody.

Write the body of a reverse index file, usually the forward index positions of the given objects, sorted by those objects' pack file offsets.

Parameters
objectsByIndexPos:List<? extends PackedObjectInfo>

the objects whose forward index file positions should be written, sorted by forward index file position; not modified during method

Annotations
@Override
Exceptions
IOException:
if writing the output fails
writeHeaderback to summary
protected void writeHeader() throws IOException

Implements abstract org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter.writeHeader.

Doc from org.eclipse.jgit.internal.storage.file.PackReverseIndexWriter.writeHeader.

Write the header of a reverse index file, usually the magic bytes and the file format version.

Annotations
@Override
Exceptions
IOException:
if writing the output fails
org.eclipse.jgit.internal.storage.file back to summary

private Class PackReverseIndexWriterV1.IndexPositionsByOffsetComparator

extends Object
implements IntComparator
Class Inheritance
  • java.lang.Object
  • org.eclipse.jgit.internal.storage.file.PackReverseIndexWriterV1.IndexPositionsByOffsetComparator
All Implemented Interfaces
org.eclipse.jgit.util.IntList.IntComparator

Field Summary

Modifier and TypeField and Description
private List<? extends PackedObjectInfo>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
compare(int
the first int to compare
firstIndexPosition
,
int
the second int to compare
secondIndexPosition
)

Implements org.eclipse.jgit.util.IntList.IntComparator.compare.

Compares the two int arguments for order.

private long
getOffset(int indexPosition)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

objectsByIndexPosback to summary
private List<? extends PackedObjectInfo> objectsByIndexPos

Constructor Detail

IndexPositionsByOffsetComparatorback to summary
private IndexPositionsByOffsetComparator(List<? extends PackedObjectInfo> objectsByIndexPos)

Method Detail

compareback to summary
public int compare(int firstIndexPosition, int secondIndexPosition)

Implements org.eclipse.jgit.util.IntList.IntComparator.compare.

Doc from org.eclipse.jgit.util.IntList.IntComparator.compare.

Compares the two int arguments for order.

Parameters
firstIndexPosition:int

the first int to compare

secondIndexPosition:int

the second int to compare

Returns:int

a negative number if first < second, 0 if first == second, or a positive number if first > second

Annotations
@Override
getOffsetback to summary
private long getOffset(int indexPosition)