openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awh...@apache.org
Subject svn commit: r431635 - /incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java
Date Tue, 15 Aug 2006 16:16:58 GMT
Author: awhite
Date: Tue Aug 15 09:16:57 2006
New Revision: 431635

URL: http://svn.apache.org/viewvc?rev=431635&view=rev
Log:
Marc correctly pointed out that FileInputStream.read() isn't guaranteed to 
read all available data into the given buffer in one call.


Modified:
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java?rev=431635&r1=431634&r2=431635&view=diff
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java
(original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/FileMetaDataIterator.java
Tue Aug 15 09:16:57 2006
@@ -147,7 +147,8 @@
                     content = bout.toByteArray();
                 } else {
                     content = new byte[(int) len];
-                    fin.read(content);
+                    for (int r, o = 0; o < content.length && (r = fin.
+                        read(content, o, content.length - o)) != -1; o += r);
                 }
                 return content;
             } finally {



Mime
View raw message