return super.read();
}
public int read(byte[] b, int off, int len) throws IOException {
- int ret = super.read(b, off, len);
- if (ret != -1) bytesDownloaded += ret;
+ int ret = 0;
+
+ // Ugly hack to work around libgcj zlib bug -- always try to fill the buffer completely
+ while (len > 0) {
+ int read = super.read(b, off, len);
+ if (read == -1) break;
+ ret += read;
+ len -= read;
+ off += read;
+ }
+
if (clear && callback != null) {
clear = false;
ThreadMessage.newthread(new JSObject.JSFunction() {
}
});
}
+
+ bytesDownloaded += ret;
return ret;
}
});
for(ZipEntry ze = zis.getNextEntry(); ze != null; ze = zis.getNextEntry()) {
String name = ze.getName();
+ if (Log.on) Log.log(Resources.class, name);
if (!validResourceName(name.substring(name.lastIndexOf('/') + 1))) {
if (Log.on) Log.log(Resources.class, "WARNING: ignoring xwar entry with invalid name: " + name);
continue;