harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r788704 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackInputStream.java
Date Fri, 26 Jun 2009 14:00:04 GMT
Author: tellison
Date: Fri Jun 26 14:00:04 2009
New Revision: 788704

URL: http://svn.apache.org/viewvc?rev=788704&view=rev
Log:
Apply patch for HARMONY-6094 ([classlib][luni] Performance improvement patch in java.io.PushbackInputStream#unread(byte[]
buffer, int offset, int length))

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackInputStream.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackInputStream.java?rev=788704&r1=788703&r2=788704&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackInputStream.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackInputStream.java
Fri Jun 26 14:00:04 2009
@@ -300,9 +300,11 @@
             throw new ArrayIndexOutOfBoundsException();
         }
 
-        for (int i = offset + length - 1; i >= offset; i--) {
-            unread(buffer[i]);
+        if (buf == null) {
+            throw new IOException();
         }
+        System.arraycopy(buffer, offset, buf, pos - length, length);
+        pos = pos - length;
     }
 
     /**



Mime
View raw message