From eeb4099cfa7b279ebd2a252631f4c3324207080e Mon Sep 17 00:00:00 2001 From: Otis Gospodnetic Date: Fri, 3 Oct 2003 10:24:46 +0000 Subject: [PATCH] - Fixed a bug when dealing with large indices - Added Javadoc. git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150078 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/index/FieldsReader.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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++) {