Class BlockDirectInvertedOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class BlockDirectInvertedOutputStream
    extends DirectInvertedOutputStream
    Writes a block direct or block inverted index, when passed appropriate posting lists.
    Since:
    2.0
    Author:
    Craig Macdonald
    • Constructor Detail

      • BlockDirectInvertedOutputStream

        public BlockDirectInvertedOutputStream​(java.lang.String filename)
                                        throws java.io.IOException
        Creates a new output stream, writing a BitOutputStream to the specified file. The number of binary bits for fields must also be specified.
        Parameters:
        filename - Location of the file to write to
        Throws:
        java.io.IOException
      • BlockDirectInvertedOutputStream

        public BlockDirectInvertedOutputStream​(BitOut out)
        Creates a new output stream, writing to the specified BitOut implementation. The number of binary bits for fields must also be specified.
        Parameters:
        out - BitOut implementation to write the file to
      • BlockDirectInvertedOutputStream

        public BlockDirectInvertedOutputStream​(java.io.OutputStream os)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • writeNoFieldPostings

        protected BitIndexPointer writeNoFieldPostings​(int[][] postings,
                                                       int offset,
                                                       int length,
                                                       int firstId)
                                                throws java.io.IOException
        Writes the given block postings to the bit file. This method assumes that field information is not provided.
        Overrides:
        writeNoFieldPostings in class DirectInvertedOutputStream
        Parameters:
        postings - the postings list to write.
        firstId - the first identifier to write. This can be an id plus one, or the gap of the current id and the previous one.
        offset - The location of the first posting to write out.
        length - The number of postings to be written out.
        Throws:
        java.io.IOException - if an error occurs during writing to a file.