From cc5e5a36fa28670e6e6bb1a74eae359a2c6cd8ab Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Sat, 13 Oct 2007 16:12:35 +0000 Subject: [PATCH] OPENJPA-402 Complete .class file read in ZipFileMetaDataIterator git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@584420 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/openjpa/lib/meta/ZipFileMetaDataIterator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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;