Class PackObjectSizeIndexWriter


  • public abstract class PackObjectSizeIndexWriter
    extends Object
    Write an object index in the output stream
    • Field Detail

      • HEADER

        protected static final byte[] HEADER
        Magic constant for the object size index file
    • Constructor Detail

      • PackObjectSizeIndexWriter

        public PackObjectSizeIndexWriter()
    • Method Detail

      • createWriter

        public static PackObjectSizeIndexWriter createWriter​(OutputStream os,
                                                             int minSize)
        Returns a writer for the latest index version
        Parameters:
        os - Output stream where to write the index
        minSize - objects strictly smaller than this size won't be added to the index. Negative size won't write AT ALL. Other sizes could write an empty index.
        Returns:
        the index writer
      • write

        public abstract void write​(List<? extends PackedObjectInfo> objs)
                            throws IOException
        Add the objects to the index
        Parameters:
        objs - objects in the pack, in sha1 order. Their position in the list matches their position in the primary index.
        Throws:
        IOException - problem writing to the stream