Hi,

Committed.

Regards,
Jeroen

2006-09-14  Jeroen Frijters  <[EMAIL PROTECTED]>

        PR classpath/28984
        * java/io/InputStreamReader.java
        (read(char[],int,int)): Fixed bug.
Index: java/io/InputStreamReader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/io/InputStreamReader.java,v
retrieving revision 1.30
diff -u -r1.30 InputStreamReader.java
--- java/io/InputStreamReader.java      21 Aug 2006 10:01:19 -0000      1.30
+++ java/io/InputStreamReader.java      14 Sep 2006 08:00:40 -0000
@@ -368,6 +368,8 @@
     if(decoder != null)
       {
        int totalBytes = (int)((double) length * maxBytesPerChar);
+        if (byteBuffer != null)
+          totalBytes = Math.max(totalBytes, byteBuffer.remaining());
        byte[] bytes;
         // Fetch cached bytes array if available and big enough.
         synchronized(cacheLock)

Reply via email to