diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipFileMetaDataIterator.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipFileMetaDataIterator.java index acc4d7376..57ae0cfe5 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipFileMetaDataIterator.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipFileMetaDataIterator.java @@ -142,7 +142,12 @@ public class ZipFileMetaDataIterator content = bout.toByteArray(); } else { content = new byte[(int) size]; - in.read(content); + int offset = 0; + int read; + while (offset < size && + (read = in.read(content, offset, (int) size - offset)) != -1) { + offset += read; + } } in.close(); return content;