The reverse index file format is specified at https://git-scm.com/docs/pack-format#_pack_rev_files_have_the_format.
| Modifier and Type | Field and Description |
|---|---|
| protected final DataOutput | dataOutput
Stream to write primitive type contents to while maintaining a checksum. |
| private static final int | |
| protected final DigestOutputStream | out
Stream to write contents to while maintaining a checksum. |
| Access | Constructor and Description |
|---|---|
| protected | PackReverseIndexWriter(OutputStream
the OutputStream that the instance will write contents to dst)Construct the components of a PackReverseIndexWriter that are shared between subclasses. |
| Modifier and Type | Method and Description |
|---|---|
| public static PackReverseIndexWriter | Returns: the new writer instancethe OutputStream that contents will be written to dst)Create a writer instance for the default file format version. |
| public static PackReverseIndexWriter | Returns: the new writer instancethe OutputStream that contents will be written to dst, int the reverse index format version to write contents as version)Create a writer instance for the specified file format version. |
| public void | write(List<? extends PackedObjectInfo>
the objects whose forward index file positions should be
written, sorted by forward index file position (currently SHA1
ordering) objectsByIndexPos, byte[] the checksum of the corresponding pack file packChecksum)Write the contents of a reverse index file for the given objects. |
| protected abstract 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 objectsSortedByIndexPosition)Write the body of a reverse index file, usually the forward index positions of the given objects, sorted by those objects' pack file offsets. |
| private void | |
| protected abstract void | writeHeader()
Write the header of a reverse index file, usually the magic bytes and the file format version. |
| dataOutput | back to summary |
|---|---|
| protected final DataOutput dataOutput Stream to write primitive type contents to while maintaining a checksum. | |
| DEFAULT_VERSION | back to summary |
|---|---|
| private static final int DEFAULT_VERSION | |
| out | back to summary |
|---|---|
| protected final DigestOutputStream out Stream to write contents to while maintaining a checksum. | |
| PackReverseIndexWriter | back to summary |
|---|---|
| protected PackReverseIndexWriter(OutputStream dst) Construct the components of a PackReverseIndexWriter that are shared between subclasses.
| |
| createWriter | back to summary |
|---|---|
| public static PackReverseIndexWriter createWriter(OutputStream dst) Create a writer instance for the default file format version.
| |
| createWriter | back to summary |
|---|---|
| public static PackReverseIndexWriter createWriter(OutputStream dst, int version) Create a writer instance for the specified file format version.
| |
| write | back to summary |
|---|---|
| public void write(List<? extends PackedObjectInfo> objectsByIndexPos, byte[] packChecksum) throws IOException Write the contents of a reverse index file for the given objects.
| |
| writeBody | back to summary |
|---|---|
| protected abstract void writeBody(List<? extends PackedObjectInfo> objectsSortedByIndexPosition) throws IOException Write the body of a reverse index file, usually the forward index positions of the given objects, sorted by those objects' pack file offsets.
| |
| writeFooter | back to summary |
|---|---|
| private void writeFooter(byte[] packChecksum) throws IOException | |
| writeHeader | back to summary |
|---|---|
| protected abstract void writeHeader() throws IOException Write the header of a reverse index file, usually the magic bytes and the file format version.
| |