本文整理汇总了C#中Lucene.Net.Store.RAMDirectory.CreateOutput方法的典型用法代码示例。如果您正苦于以下问题:C# RAMDirectory.CreateOutput方法的具体用法?C# RAMDirectory.CreateOutput怎么用?C# RAMDirectory.CreateOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Store.RAMDirectory
的用法示例。
在下文中一共展示了RAMDirectory.CreateOutput方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestDetectClose
public virtual void TestDetectClose()
{
Directory dir = new RAMDirectory();
dir.Close();
Assert.Throws<AlreadyClosedException>(() => dir.CreateOutput("test"), "did not hit expected exception");
dir = FSDirectory.Open(new System.IO.DirectoryInfo(AppSettings.Get("tempDir", System.IO.Path.GetTempPath())));
dir.Close();
Assert.Throws<AlreadyClosedException>(() => dir.CreateOutput("test"), "did not hit expected exception");
}
示例2: TestDetectClose
public virtual void TestDetectClose()
{
Directory dir = new RAMDirectory();
dir.Close();
try
{
dir.CreateOutput("test");
Assert.Fail("did not hit expected exception");
}
catch (AlreadyClosedException ace)
{
}
dir = FSDirectory.Open(new System.IO.FileInfo(Support.AppSettings.Get("tempDir", System.IO.Path.GetTempPath())));
dir.Close();
try
{
dir.CreateOutput("test");
Assert.Fail("did not hit expected exception");
}
catch (AlreadyClosedException ace)
{
}
}
示例3: TestIllegalEOF
public virtual void TestIllegalEOF()
{
RAMDirectory dir = new RAMDirectory();
IndexOutput o = dir.CreateOutput("out");
byte[] b = new byte[1024];
o.WriteBytes(b, 0, 1024);
o.Close();
IndexInput i = dir.OpenInput("out");
i.Seek(1024);
i.Close();
dir.Close();
}
示例4: TestSeekToEOFThenBack
public virtual void TestSeekToEOFThenBack()
{
RAMDirectory dir = new RAMDirectory();
IndexOutput o = dir.CreateOutput("out", NewIOContext(Random()));
var bytes = new byte[3 * RAMInputStream.BUFFER_SIZE];
o.WriteBytes(bytes, 0, bytes.Length);
o.Dispose();
IndexInput i = dir.OpenInput("out", NewIOContext(Random()));
i.Seek(2 * RAMInputStream.BUFFER_SIZE - 1);
i.Seek(3 * RAMInputStream.BUFFER_SIZE);
i.Seek(RAMInputStream.BUFFER_SIZE);
i.ReadBytes(bytes, 0, 2 * RAMInputStream.BUFFER_SIZE);
i.Dispose();
dir.Dispose();
}
示例5: TestIllegalEOF
public virtual void TestIllegalEOF()
{
RAMDirectory dir = new RAMDirectory();
IndexOutput o = dir.CreateOutput("out", NewIOContext(Random()));
var b = new byte[1024];
o.WriteBytes(b, 0, 1024);
o.Dispose();
IndexInput i = dir.OpenInput("out", NewIOContext(Random()));
i.Seek(1024);
i.Dispose();
dir.Dispose();
}