Top Description Inners Constructors Methods
org.eclipse.jgit.internal.storage.midx

public Class MultiPackIndexPrettyPrinter

extends Object
Class Inheritance
Annotations
@SuppressWarnings:boxing, nls
Static Imports
java.nio.charset.StandardCharsets.UTF_8, org.eclipse.jgit.internal.storage.midx.MultiPackIndexConstants.CHUNK_LOOKUP_WIDTH

Prints a multipack index file in a human-readable format.
Since
7.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
prettyPrint(byte[]
the bytes of a multipack index
rawMidx
,
PrintWriter
a writer
out
)

Writes to out, in human-readable format, the multipack index in rawMidx

private static int
printChunkLookup(PrintWriter out, byte[] rawMidx, int chunkCount, List<MultiPackIndexPrettyPrinter.ChunkSegment> chunkSegments)

private static int
printOIDF(PrintWriter out, byte[] rawMidx, int start)

private static int
printOIDL(PrintWriter out, byte[] rawMidx, int start, long end)

private static int
printOOFF(PrintWriter out, byte[] rawMidx, int start, long end)

private static int
printPNAM(PrintWriter out, byte[] rawMidx, int start, long end)

private static int
printRIDX(PrintWriter out, byte[] rawMidx, int start, long end)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MultiPackIndexPrettyPrinterback to summary
public MultiPackIndexPrettyPrinter()

Method Detail

prettyPrintback to summary
public static void prettyPrint(byte[] rawMidx, PrintWriter out)

Writes to out, in human-readable format, the multipack index in rawMidx

Parameters
rawMidx:byte[]

the bytes of a multipack index

out:PrintWriter

a writer

printChunkLookupback to summary
private static int printChunkLookup(PrintWriter out, byte[] rawMidx, int chunkCount, List<MultiPackIndexPrettyPrinter.ChunkSegment> chunkSegments)
printOIDFback to summary
private static int printOIDF(PrintWriter out, byte[] rawMidx, int start)
printOIDLback to summary
private static int printOIDL(PrintWriter out, byte[] rawMidx, int start, long end)
printOOFFback to summary
private static int printOOFF(PrintWriter out, byte[] rawMidx, int start, long end)
printPNAMback to summary
private static int printPNAM(PrintWriter out, byte[] rawMidx, int start, long end)
printRIDXback to summary
private static int printRIDX(PrintWriter out, byte[] rawMidx, int start, long end)
org.eclipse.jgit.internal.storage.midx back to summary

private final Record MultiPackIndexPrettyPrinter.ChunkSegment

extends Record
Class Inheritance
Record Components
chunkName:String 
startOffset:long 

Field Summary

Modifier and TypeField and Description
private final String
chunkName

Record Component accessed by chunkName().

private final long
startOffset

Record Component accessed by startOffset().

Constructor Summary

AccessConstructor and Description
private
ChunkSegment(String chunkName, long startOffset)

Method Summary

Modifier and TypeMethod and Description
public String
chunkName()

Record Component getter of chunkName.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public long
startOffset()

Record Component getter of startOffset.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

chunkNameback to summary
private final String chunkName

Record Component accessed by chunkName().

startOffsetback to summary
private final long startOffset

Record Component accessed by startOffset().

Constructor Detail

ChunkSegmentback to summary
private ChunkSegment(String chunkName, long startOffset)

Method Detail

chunkNameback to summary
public String chunkName()

Record Component getter of chunkName.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

startOffsetback to summary
public long startOffset()

Record Component getter of startOffset.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.