Lucene.Net.Store.MMapDirectory.CreateSlicer C# (CSharp) Method

CreateSlicer() public method

public CreateSlicer ( string name, IOContext context ) : IndexInputSlicer
name string
context IOContext
return IndexInputSlicer
        public override IndexInputSlicer CreateSlicer(string name, IOContext context)
        {
            var full = (MMapIndexInput)OpenInput(name, context);

            return new IndexInputSlicerAnonymousInnerClassHelper(this, full);
        }

Usage Example

示例#1
0
 public virtual void TestSeekSliceEnd()
 {
     for (int i = 0; i < 17; i++)
     {
         MMapDirectory mmapDir = new MMapDirectory(CreateTempDir("testSeekSliceEnd"), null, 1 << i);
         IndexOutput   io      = mmapDir.CreateOutput("bytes", NewIOContext(Random));
         var           bytes   = new byte[1 << i];
         Random.NextBytes(bytes);
         io.WriteBytes(bytes, bytes.Length);
         io.Dispose();
         IndexInputSlicer slicer = mmapDir.CreateSlicer("bytes", NewIOContext(Random));
         IndexInput       ii     = slicer.OpenSlice("full slice", 0, bytes.Length);
         var actual = new byte[1 << i];
         ii.ReadBytes(actual, 0, actual.Length);
         Assert.AreEqual(new BytesRef(bytes), new BytesRef(actual));
         ii.Seek(1 << i);
         ii.Dispose();
         slicer.Dispose();
         mmapDir.Dispose();
     }
 }
All Usage Examples Of Lucene.Net.Store.MMapDirectory::CreateSlicer