Author: nextgens
Date: 2008-08-17 18:55:20 +0000 (Sun, 17 Aug 2008)
New Revision: 21983
Modified:
trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
Log:
bug #2501: no need to copy up to the full size in fact
Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
2008-08-17 18:53:56 UTC (rev 21982)
+++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
2008-08-17 18:55:20 UTC (rev 21983)
@@ -59,7 +59,7 @@
}
if((buf.length != maxLength) && (buf.length - ctr <
bufferSize)) {
byte[] newBuf = new byte[Math.min(buf.length *
2, maxLength)];
- System.arraycopy(buf, 0, newBuf, 0, buf.length);
+ System.arraycopy(buf, 0, newBuf, 0, ctr);
buf = newBuf;
}
}