Lucene.Net.Index.IndexReader.EnsureOpen C# (CSharp) 메소드

EnsureOpen() 보호된 메소드

protected EnsureOpen ( ) : void
리턴 void
        protected internal void EnsureOpen()
		{
		    if (refCount <= 0)
		    {
		        throw new AlreadyClosedException("this IndexReader is closed");
		    }
		}
		

Usage Example

		private void  AssertReaderOpen(IndexReader reader)
		{
			reader.EnsureOpen();
			
			if (reader is MultiSegmentReader)
			{
				SegmentReader[] subReaders = ((MultiSegmentReader) reader).GetSubReaders();
				for (int i = 0; i < subReaders.Length; i++)
				{
					AssertReaderOpen(subReaders[i]);
				}
			}
		}