Index: java/src/org/apache/xindice/core/filer/BTree.java
===================================================================
RCS file: /home/cvspublic/xml-xindice/java/src/org/apache/xindice/core/filer/BTree.java,v
retrieving revision 1.26
diff -u -r1.26 BTree.java
--- java/src/org/apache/xindice/core/filer/BTree.java	20 Mar 2004 14:02:38 -0000	1.26
+++ java/src/org/apache/xindice/core/filer/BTree.java	15 Jul 2004 21:30:25 -0000
@@ -487,25 +487,34 @@
         public synchronized void read() throws IOException {
             if (!this.loaded) {
                 Value v = readValue(page);
-                DataInputStream is = new DataInputStream(v.getInputStream());
+                
+                DataInputStream is = null;
+                
+                try {
+                    is = new DataInputStream(v.getInputStream());
 
-                // Read in the Values
-                values = new Value[ph.getValueCount()];
-                for (int i = 0; i < values.length; i++) {
-                    short valSize = is.readShort();
-                    byte[] b = new byte[valSize];
-
-                    is.read(b);
-                    values[i] = new Value(b);
-                }
-
-                // Read in the pointers
-                ptrs = new long[ph.getPointerCount()];
-                for (int i = 0; i < ptrs.length; i++) {
-                    ptrs[i] = is.readLong();
-                }
-
-                this.loaded = true;
+	                // Read in the Values
+	                values = new Value[ph.getValueCount()];
+	                for (int i = 0; i < values.length; i++) {
+	                    short valSize = is.readShort();
+	                    byte[] b = new byte[valSize];
+	
+	                    is.read(b);
+	                    values[i] = new Value(b);
+	                }
+	
+	                // Read in the pointers
+	                ptrs = new long[ph.getPointerCount()];
+	                for (int i = 0; i < ptrs.length; i++) {
+	                    ptrs[i] = is.readLong();
+	                }
+	
+	                this.loaded = true;
+	         }
+	         finally {
+	             if (is != null)
+	                is.close();
+                }
             }
         }
 
