Пример #1
0
        public virtual void TestSimpleIntBlocks()
        {
            Directory dir = NewDirectory();

            IntStreamFactory f = (new MockFixedIntBlockPostingsFormat(128)).getIntFactory();

            IntIndexOutput @out = f.CreateOutput(dir, "test", NewIOContext(Random()));

            for (int i = 0; i < 11777; i++)
            {
                @out.Write(i);
            }
            @out.Dispose();

            IntIndexInput       @in = f.OpenInput(dir, "test", NewIOContext(Random()));
            IntIndexInputReader r   = @in.Reader();

            for (int i = 0; i < 11777; i++)
            {
                assertEquals(i, r.Next());
            }
            @in.Dispose();

            dir.Dispose();
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testSimpleIntBlocks() throws Exception
        public virtual void testSimpleIntBlocks()
        {
            Directory dir = newDirectory();

            IntStreamFactory f = (new MockFixedIntBlockPostingsFormat(128)).IntFactory;

            IntIndexOutput @out = f.createOutput(dir, "test", newIOContext(random()));

            for (int i = 0; i < 11777; i++)
            {
                @out.write(i);
            }
            @out.close();

            IntIndexInput @in = f.openInput(dir, "test", newIOContext(random()));

            IntIndexInput.Reader r = @in.reader();

            for (int i = 0; i < 11777; i++)
            {
                assertEquals(i, r.next());
            }
            @in.close();

            dir.close();
        }
Пример #3
0
        public virtual void TestEmptySimpleIntBlocks()
        {
            Directory dir = NewDirectory();

            IntStreamFactory f    = (new MockFixedIntBlockPostingsFormat(128)).getIntFactory();
            IntIndexOutput   @out = f.CreateOutput(dir, "test", NewIOContext(Random()));

            // write no ints
            @out.Dispose();

            IntIndexInput @in = f.OpenInput(dir, "test", NewIOContext(Random()));

            @in.Reader();
            // read no ints
            @in.Dispose();
            dir.Dispose();
        }
Пример #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testEmptySimpleIntBlocks() throws Exception
        public virtual void testEmptySimpleIntBlocks()
        {
            Directory dir = newDirectory();

            IntStreamFactory f    = (new MockFixedIntBlockPostingsFormat(128)).IntFactory;
            IntIndexOutput   @out = f.createOutput(dir, "test", newIOContext(random()));

            // write no ints
            @out.close();

            IntIndexInput @in = f.openInput(dir, "test", newIOContext(random()));

            @in.reader();
            // read no ints
            @in.close();
            dir.close();
        }
Пример #5
0
 public IntBlockIndexOuput(IntIndexOutput outerInstance)
 {
     _outerInstance = outerInstance;
 }
Пример #6
0
 public IntBlockIndexOuput(IntIndexOutput outerInstance)
 {
     _outerInstance = outerInstance;
 }