当前位置: 首页>>代码示例>>C#>>正文


C# RAMDirectory.CreateOutput方法代码示例

本文整理汇总了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");
		}
开发者ID:synhershko,项目名称:lucene.net,代码行数:11,代码来源:TestDirectory.cs

示例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)
			{
			}
		}
开发者ID:kstenson,项目名称:NHibernate.Search,代码行数:24,代码来源:TestDirectory.cs

示例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();
		}
开发者ID:Rationalle,项目名称:ravendb,代码行数:12,代码来源:TestRAMDirectory.cs

示例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();
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:17,代码来源:TestRAMDirectory.cs

示例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();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:12,代码来源:TestRAMDirectory.cs


注:本文中的Lucene.Net.Store.RAMDirectory.CreateOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。