public override IndexInputSlicer CreateSlicer(string name, IOContext context)
{
MaybeYield();
if (!LuceneTestCase.SlowFileExists(@in, name))
{
throw RandomState.NextBoolean() ? new FileNotFoundException(name) : new FileNotFoundException(name);
}
// cannot open a file for input if it's still open for
// output, except for segments.gen and segments_N
if (OpenFilesForWrite.Contains(name) && !name.StartsWith("segments"))
{
throw (System.IO.IOException)FillOpenTrace(new System.IO.IOException("MockDirectoryWrapper: file \"" + name + "\" is still open for writing"), name, false);
}
IndexInputSlicer delegateHandle = @in.CreateSlicer(name, context);
IndexInputSlicer handle = new IndexInputSlicerAnonymousInnerClassHelper(this, name, delegateHandle);
AddFileHandle(handle, name, Handle.Slice);
return handle;
}