Exemplo n.º 1
0
        /// <summary>Bulk write a contiguous series of documents.  The
        /// lengths array is the length (in bytes) of each raw
        /// document.  The stream IndexInput is the
        /// fieldsStream from which we should bulk-copy all
        /// bytes.
        /// </summary>
        internal void  AddRawDocuments(IndexInput stream, int[] lengths, int numDocs)
        {
            long position = fieldsStream.GetFilePointer();
            long start    = position;

            for (int i = 0; i < numDocs; i++)
            {
                indexStream.WriteLong(position);
                position += lengths[i];
            }
            fieldsStream.CopyBytes(stream, position - start);
            System.Diagnostics.Debug.Assert(fieldsStream.GetFilePointer() == position);
        }