diff --git a/src/java/org/apache/lucene/index/FieldsReader.java b/src/java/org/apache/lucene/index/FieldsReader.java index 5682d06716d..514b13ff9a7 100644 --- a/src/java/org/apache/lucene/index/FieldsReader.java +++ b/src/java/org/apache/lucene/index/FieldsReader.java @@ -61,20 +61,25 @@ import org.apache.lucene.store.InputStream; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; +/** + * Class responsible for access to stored document fields. + * It uses <segment>.fdt and <segment>.fdx; files. + * + * @version $Id$ + */ final class FieldsReader { private FieldInfos fieldInfos; private InputStream fieldsStream; private InputStream indexStream; private int size; - FieldsReader(Directory d, String segment, FieldInfos fn) - throws IOException { + FieldsReader(Directory d, String segment, FieldInfos fn) throws IOException { fieldInfos = fn; fieldsStream = d.openFile(segment + ".fdt"); indexStream = d.openFile(segment + ".fdx"); - size = (int)indexStream.length() / 8; + size = (int)(indexStream.length() / 8); } final void close() throws IOException { @@ -90,7 +95,7 @@ final class FieldsReader { indexStream.seek(n * 8L); long position = indexStream.readLong(); fieldsStream.seek(position); - + Document doc = new Document(); int numFields = fieldsStream.readVInt(); for (int i = 0; i < numFields; i++) {