Fix bug in getZipEntryContent() where entries aren't fully read if not immediately available.

This commit is contained in:
hns 2005-03-07 17:15:20 +00:00
parent d66c3965d4
commit 46fc141e97

View file

@ -214,7 +214,13 @@ public class ZippedAppFile implements Updatable {
char[] c = new char[size];
InputStreamReader reader = new InputStreamReader(zip.getInputStream(entry));
reader.read(c);
int read = 0;
while (read < size) {
int r = reader.read(c, read, size-read);
if (r == -1)
break;
read += r;
}
return new String(c);
}