Package org.apache.lucene.store

Examples of org.apache.lucene.store.IndexInput.readByte()


    final String segmentsFileName = SegmentInfos.getCurrentSegmentFileName(dir);
    IndexInput in = dir.openInput(segmentsFileName);
    IndexOutput out = dir.createOutput(IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", 1+gen));
    out.copyBytes(in, in.length()-1);
    byte b = in.readByte();
    out.writeByte((byte) (1+b));
    out.close();
    in.close();

    IndexReader reader = null;
View Full Code Here


                        // do a list of the files
                        store.directory().listAll();

                        // do a seek and read some byes
                        ii.seek(ii.length() / 2);
                        ii.readByte();
                        ii.readByte();

                        // do a list of the files
                        store.directory().listAll();
                    }
View Full Code Here

                        store.directory().listAll();

                        // do a seek and read some byes
                        ii.seek(ii.length() / 2);
                        ii.readByte();
                        ii.readByte();

                        // do a list of the files
                        store.directory().listAll();
                    }
                }
View Full Code Here

        stopWatch.start();
        for (String staticFile : staticFiles) {
            IndexInput ii = store.directory().openInput(staticFile);
            // do a full read
            for (long counter = 0; counter < ii.length(); counter++) {
                byte result = ii.readByte();
                if (result != 1) {
                    System.out.println("Failure, read wrong value [" + result + "]");
                }
            }
            // do a list of the files
View Full Code Here

                        store.directory().listAll();

                        IndexInput ii = store.directory().openInput(staticFile);
                        // do a full read
                        for (long counter = 0; counter < ii.length(); counter++) {
                            byte result = ii.readByte();
                            if (result != 1) {
                                System.out.println("Failure, read wrong value [" + result + "]");
                            }
                        }
                        // do a list of the files
View Full Code Here

        indexInput.readBytes(test, 0, 5);
        assertThat(test[0], equalTo((byte) 1));
        assertThat(test[4], equalTo((byte) 5));

        indexInput.seek(28);
        assertThat(indexInput.readByte(), equalTo((byte) 4));
        indexInput.seek(30);
        assertThat(indexInput.readByte(), equalTo((byte) 6));

        indexInput.seek(0);
        indexInput.readBytes(test, 0, 5);
View Full Code Here

        assertThat(test[4], equalTo((byte) 5));

        indexInput.seek(28);
        assertThat(indexInput.readByte(), equalTo((byte) 4));
        indexInput.seek(30);
        assertThat(indexInput.readByte(), equalTo((byte) 6));

        indexInput.seek(0);
        indexInput.readBytes(test, 0, 5);
        assertThat(test[0], equalTo((byte) 8));
View Full Code Here

        indexInput.close();

        indexInput = dir.openInput("value1");
        // iterate over all the data
        for (int i = 0; i < 38; i++) {
            indexInput.readByte();
        }
        indexInput.close();
    }

}
View Full Code Here

  private void testEof(String name, Directory directory, long length) throws IOException {
    IndexInput input = directory.openInput(name, IOContext.DEFAULT);
    input.seek(length);
    try {
      input.readByte();
      fail("should throw eof");
    } catch (IOException e) {
    }
  }
View Full Code Here

      final String version = input.readString();
      final int docCount = input.readInt();
      if (docCount < 0) {
        throw new CorruptIndexException("invalid docCount: " + docCount + " (resource=" + input + ")");
      }
      final boolean isCompoundFile = input.readByte() == SegmentInfo.YES;
      final Map<String, String> diagnostics = input.readStringStringMap();
      final Map<String, String> attributes = input.readStringStringMap();
      final Set<String> files = input.readStringSet();

      if (input.getFilePointer() != input.length()) {
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.