Lucene.Net.Store.RAMDirectory.OpenInput C# (CSharp) Method

OpenInput() public method

Returns a stream reading an existing file.
public OpenInput ( System name ) : IndexInput
name System
return IndexInput
		public override IndexInput OpenInput(System.String name)
		{
			EnsureOpen();
			RAMFile file;
			lock (this)
			{
				file = fileMap[name];
			}
			if (file == null)
				throw new System.IO.FileNotFoundException(name);
			return new RAMInputStream(file);
		}

Usage Example

Example #1
0
        public override IndexInput OpenInput(string name, IOContext context)
        {
            UninterruptableMonitor.Enter(this);
            try
            {
                if (VERBOSE)
                {
                    Console.WriteLine("nrtdir.openInput name=" + name);
                }
#pragma warning disable 612, 618
                if (cache.FileExists(name))
#pragma warning restore 612, 618
                {
                    if (VERBOSE)
                    {
                        Console.WriteLine("  from cache");
                    }
                    return(cache.OpenInput(name, context));
                }
                else
                {
                    return(@delegate.OpenInput(name, context));
                }
            }
            finally
            {
                UninterruptableMonitor.Exit(this);
            }
        }
All Usage Examples Of Lucene.Net.Store.RAMDirectory::OpenInput