*) Bugfix for serverCharBuffer read from file operation

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2607 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent 90ef19d778
commit 0e84a969d6

@ -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());
}

Loading…
Cancel
Save