Marc correctly pointed out that FileInputStream.read() isn't guaranteed to

read all available data into the given buffer in one call.



git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@431635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
A. Abram White 2006-08-15 16:16:57 +00:00
parent 0821efea40
commit daf1f35793
1 changed files with 2 additions and 1 deletions

View File

@ -147,7 +147,8 @@ public class FileMetaDataIterator implements MetaDataIterator {
content = bout.toByteArray(); content = bout.toByteArray();
} else { } else {
content = new byte[(int) len]; 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; return content;
} finally { } finally {