harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r833020 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java
Date Thu, 05 Nov 2009 07:59:19 GMT
Author: hindessm
Date: Thu Nov  5 07:59:18 2009
New Revision: 833020

URL: http://svn.apache.org/viewvc?rev=833020&view=rev
Log:
Patch for "[#HARMONY-6216] problem with reading zero-length file".

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

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java?rev=833020&r1=833019&r2=833020&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java
Thu Nov  5 07:59:18 2009
@@ -246,9 +246,14 @@
             while (out.hasRemaining()) {
                 // fill the buffer if needed
                 if (needInput) {
-                    if ((in.available() == 0) && (out.position() > offset)) {
-                        // we could return the result without blocking read
-                        break;
+                    try {
+                        if ((in.available() == 0) 
+                            && (out.position() > offset)) {
+                            // we could return the result without blocking read
+                            break;
+                        }
+                    } catch (IOException e) {
+                        // available didn't work so just try the read
                     }
 
                     int to_read = bytes.capacity() - bytes.limit();



Mime
View raw message