From 0e84a969d66060791d5d16399ce836975c5624de Mon Sep 17 00:00:00 2001 From: theli Date: Sat, 16 Sep 2006 13:11:32 +0000 Subject: [PATCH] *) Bugfix for serverCharBuffer read from file operation git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2607 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/server/serverCharBuffer.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/server/serverCharBuffer.java b/source/de/anomic/server/serverCharBuffer.java index 8dc118e4f..d653a3fc7 100644 --- a/source/de/anomic/server/serverCharBuffer.java +++ b/source/de/anomic/server/serverCharBuffer.java @@ -110,13 +110,16 @@ public final class serverCharBuffer extends Writer { if (f.length() > Integer.MAX_VALUE) throw new IOException("file is too large for buffering"); length = (int) f.length(); - buffer = new char[length]; + buffer = new char[length*2]; offset = 0; try { FileReader fr = new FileReader(f); - fr.read(buffer); - fr.close(); + char[] temp = new char[256]; + int c; + while ((c = fr.read(temp)) > 0) { + this.append(temp,0,c); + } } catch (FileNotFoundException e) { throw new IOException("File not found: " + f.toString() + "; " + e.getMessage()); }