Class SBIIndexMerger


  • public final class SBIIndexMerger
    extends IndexMerger<SBIIndex>
    Merges SBI files for parts of a file that have been concatenated.
    • Constructor Detail

      • SBIIndexMerger

        public SBIIndexMerger​(OutputStream out,
                              long headerLength)
        Prepare to merge SBI indexes.
        Parameters:
        out - the stream to write the merged index to
        headerLength - the length of any header that precedes the first part of the data file with an index
    • Method Detail

      • processIndex

        public void processIndex​(SBIIndex index,
                                 long partLength)
        Add an index for a part of the data file to the merged index. This method should be called for each index for the data file parts, in order.
        Specified by:
        processIndex in class IndexMerger<SBIIndex>
        Parameters:
        index - the index to merge
        partLength - the length of the part file corresponding to the index, in bytes.
      • finish

        public void finish​(long dataFileLength)
        Complete the index, and close the output stream.
        Specified by:
        finish in class IndexMerger<SBIIndex>
        Parameters:
        dataFileLength - the length of the total data file, in bytes.