text: 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);}