Package org.apache.lucene.store

Examples of org.apache.lucene.store.CompoundFileDirectory.openInput()


        dir.copy(csw, "d2", "d2", newIOContext(random()));
        csw.close();

        CompoundFileDirectory csr = new CompoundFileDirectory(dir, "d.cfs", newIOContext(random()), false);
        IndexInput expected = dir.openInput("d1", newIOContext(random()));
        IndexInput actual = csr.openInput("d1", newIOContext(random()));
        assertSameStreams("d1", expected, actual);
        assertSameSeekBehavior("d1", expected, actual);
        expected.close();
        actual.close();
View Full Code Here


        assertSameSeekBehavior("d1", expected, actual);
        expected.close();
        actual.close();

        expected = dir.openInput("d2", newIOContext(random()));
        actual = csr.openInput("d2", newIOContext(random()));
        assertSameStreams("d2", expected, actual);
        assertSameSeekBehavior("d2", expected, actual);
        expected.close();
        actual.close();
        csr.close();
View Full Code Here

        csw.close();

        CompoundFileDirectory csr = new CompoundFileDirectory(dir, "test.cfs", newIOContext(random()), false);
        for (int i=0; i<data.length; i++) {
            IndexInput check = dir.openInput(segment + data[i], newIOContext(random()));
            IndexInput test = csr.openInput(segment + data[i], newIOContext(random()));
            assertSameStreams(data[i], check, test);
            assertSameSeekBehavior(data[i], check, test);
            test.close();
            check.close();
        }
View Full Code Here

        // this test only works for FSIndexInput
        assertTrue(isSimpleFSIndexInput(expected));
        assertTrue(isSimpleFSIndexInputOpen(expected));

        IndexInput one = cr.openInput("f11", newIOContext(random()));

        IndexInput two = one.clone();

        assertSameStreams("basic clone one", expected, one);
        expected.seek(0);
View Full Code Here

        // Open two files
        IndexInput e1 = dir.openInput("f11", newIOContext(random()));
        IndexInput e2 = dir.openInput("f3", newIOContext(random()));

        IndexInput a1 = cr.openInput("f11", newIOContext(random()));
        IndexInput a2 = dir.openInput("f3", newIOContext(random()));

        // Seek the first pair
        e1.seek(100);
        a1.seek(100);
View Full Code Here

      for (int i = 0; i < files.length; ++i) {
        long len = cfr.fileLength(files[i]);

        if (extract) {
          System.out.println("extract " + files[i] + " with " + len + " bytes to local directory...");
          IndexInput ii = cfr.openInput(files[i], context);

          FileOutputStream f = new FileOutputStream(files[i]);

          // read and write with a small buffer, which is more effective than reading byte by byte
          byte[] buffer = new byte[1024];
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.