Author: nextgens
Date: 2008-08-22 15:39:41 +0000 (Fri, 22 Aug 2008)
New Revision: 22098
Modified:
trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
Log:
LineReadingInputStream: toad's right: maxLength is in bytes not in chars
Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
2008-08-22 15:11:09 UTC (rev 22097)
+++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
2008-08-22 15:39:41 UTC (rev 22098)
@@ -33,7 +33,7 @@
byte[] buf = new byte[Math.max(Math.min(128, maxLength),
Math.min(1024, bufferSize))];
int ctr = 0;
- mark(Integer.MAX_VALUE); // Might be more than maxLengh if we
use utf8
+ mark(maxLength + 2); // in case we have both a \r and a \n
while(true) {
int x = read(buf, ctr, buf.length - ctr);
if(x == -1) {