Package org.apache.lucene.store

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


     
    InputStream input = directory.openFile("segments");
    int format = 0;
    long version = 0;
    try {
      format = input.readInt();
      if(format < 0){
        if (format < FORMAT)
          throw new IOException("Unknown format version: " + format);
        version = input.readLong(); // read version
       }
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

    <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

  }

  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);
      }
    } finally {
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);
      }
    } finally {
      input.close();
View Full Code Here

    <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

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.