Package org.apache.lucene.store

Examples of org.apache.lucene.store.OutputStream.writeByte()


                                    int size)
    throws IOException
    {
        OutputStream os = dir.createFile(name);
        for (int i=0; i < size; i++) {
            os.writeByte(start);
            start ++;
        }
        os.close();
    }
View Full Code Here


    throws IOException
    {
        // Setup the test file - we need more than 1024 bytes
        OutputStream os = fsdir.createFile(file);
        for(int i=0; i<2000; i++) {
            os.writeByte((byte) i);
        }
        os.close();

        InputStream in = fsdir.openFile(file);
View Full Code Here

      FieldInfo fi = fieldInfos.fieldInfo(n);
      if(fi.isIndexed){
        float norm = fieldBoosts[n] * similarity.lengthNorm(fi.name, fieldLengths[n]);
        OutputStream norms = directory.createFile(segment + ".f" + n);
        try {
          norms.writeByte(similarity.encodeNorm(norm));
        } finally {
          norms.close();
        }
      }
    }
View Full Code Here

            int maxDoc = reader.maxDoc();
      try {
        for (int k = 0; k < maxDoc; k++) {
    byte norm = input != null ? input.readByte() : (byte)0;
    if (deletedDocs == null || !deletedDocs.get(k))
      output.writeByte(norm);
        }
      } finally {
        if (input != null)
    input.close();
      }
View Full Code Here

      Field field = (Field)fields.nextElement();
      if (field.isIndexed()) {
  int fieldNumber = fieldInfos.fieldNumber(field.name());
  OutputStream norm = directory.createFile(segment + ".f" + fieldNumber);
  try {
    norm.writeByte(Similarity.norm(fieldLengths[fieldNumber]));
  } finally {
    norm.close();
  }
      }
    }
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.