Package org.apache.lucene.store

Examples of org.apache.lucene.store.InputStream.readInt()


    <code>d</code>, as written by the {@link #write} method.
    */
  public BitVector(Directory d, String name) throws IOException {
    InputStream input = d.openFile(name);
    try {
      size = input.readInt();        // read size
      count = input.readInt();        // read count
      bits = new byte[(size >> 3) + 1];      // allocate bits
      input.readBytes(bits, 0, bits.length);    // read bits
    } finally {
      input.close();
View Full Code Here


    */
  public BitVector(Directory d, String name) throws IOException {
    InputStream input = d.openFile(name);
    try {
      size = input.readInt();        // read size
      count = input.readInt();        // read count
      bits = new byte[(size >> 3) + 1];      // allocate bits
      input.readBytes(bits, 0, bits.length);    // read bits
    } finally {
      input.close();
    }
View Full Code Here

    if (!directory.fileExists("deletable"))
      return result;

    InputStream input = directory.openFile("deletable");
    try {
      for (int i = input.readInt(); i > 0; i--)    // read file names
        result.addElement(input.readString());
    } finally {
      input.close();
    }
    return result;
View Full Code Here

  }

  public final void read(Directory directory) throws IOException {
    InputStream input = directory.openFile("segments");
    try {
      counter = input.readInt(); // read counter
      for (int i = input.readInt(); i > 0; i--) { // read segmentInfos
        SegmentInfo si =
          new SegmentInfo(input.readString(), input.readInt(), directory);
        addElement(si);
      }
View Full Code Here

  public final void read(Directory directory) throws IOException {
    InputStream input = directory.openFile("segments");
    try {
      counter = input.readInt(); // read counter
      for (int i = input.readInt(); i > 0; i--) { // read segmentInfos
        SegmentInfo si =
          new SegmentInfo(input.readString(), input.readInt(), directory);
        addElement(si);
      }
      if (input.getFilePointer() >= input.length())
View Full Code Here

    InputStream input = directory.openFile("segments");
    try {
      counter = input.readInt(); // read counter
      for (int i = input.readInt(); i > 0; i--) { // read segmentInfos
        SegmentInfo si =
          new SegmentInfo(input.readString(), input.readInt(), directory);
        addElement(si);
      }
      if (input.getFilePointer() >= input.length())
        version = 0; // old file format without version number
      else
View Full Code Here

  public final void read(Directory directory) throws IOException {
   
    InputStream input = directory.openFile("segments");
    try {
      int format = input.readInt();
      if(format < 0){     // file contains explicit format info
        // check that it is a format we can understand
        if (format < FORMAT)
          throw new IOException("Unknown format version: " + format);
        version = input.readLong(); // read version
View Full Code Here

      if(format < 0){     // file contains explicit format info
        // check that it is a format we can understand
        if (format < FORMAT)
          throw new IOException("Unknown format version: " + format);
        version = input.readLong(); // read version
        counter = input.readInt(); // read counter
      }
      else{     // file is in old format without explicit format info
        counter = format;
      }
     
View Full Code Here

      }
      else{     // file is in old format without explicit format info
        counter = format;
      }
     
      for (int i = input.readInt(); i > 0; i--) { // read segmentInfos
        SegmentInfo si =
          new SegmentInfo(input.readString(), input.readInt(), directory);
        addElement(si);
      }
     
View Full Code Here

        counter = format;
      }
     
      for (int i = input.readInt(); i > 0; i--) { // read segmentInfos
        SegmentInfo si =
          new SegmentInfo(input.readString(), input.readInt(), directory);
        addElement(si);
      }
     
      if(format >= 0){    // in old format the version number may be at the end of the file
        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.