private void Close()
{
if (closed)
return;
Cleanup ();
DoClose ();
if (currentReader != null)
currentReader.Close ();
if (currentStream != null) {
// When crawling, give the OS a hint that we don't
// need to keep this file around in the page cache.
if (indexable.FlushBufferCache && currentStream is FileStream)
FileAdvise.FlushCache ((FileStream) currentStream);
currentStream.Close ();
currentStream = null;
}
if (snippetWriter != null)
snippetWriter.Close ();
closed = true;
}