public void finish(FieldInfos fis, int numDocs) throws IOException {if (numBufferedDocs > 0) {flush();numDirtyChunks++; } else {assert bufferedDocs.size() == 0;}if (docBase != numDocs) {throw new RuntimeException("Wrote " + docBase + " docs, finish called with numDocs=" + numDocs);}indexWriter.finish(numDocs, fieldsStream.getFilePointer());fieldsStream.writeVLong(numChunks);fieldsStream.writeVLong(numDirtyChunks);CodecUtil.writeFooter(fieldsStream);assert bufferedDocs.size() == 0;}
public override void Finish(FieldInfos fis, int numDocs){if (numBufferedDocs > 0){Flush();}else{Debug.Assert(bufferedDocs.Length == 0);}if (docBase != numDocs){throw new Exception("Wrote " + docBase + " docs, finish called with numDocs=" + numDocs);}indexWriter.Finish(numDocs, fieldsStream.GetFilePointer());CodecUtil.WriteFooter(fieldsStream);Debug.Assert(bufferedDocs.Length == 0);}