public int read(byte[] b, int off, int len) throws IOException {
int ret = super.read(b, off, len);
if (ret != 1) bytesDownloaded += ret;
- Scheduler.add(new Scheduler.Task() { public Object call(Object arg) {
+ Scheduler.add(new Scheduler.Task() { public void perform() {
JS.Array args = new JS.Array();
args.addElement(new Integer(bytesDownloaded));
args.addElement(new Integer(is instanceof KnownLength ? ((KnownLength)is).getLength() : 0));
- // FIXME
- // new JS.Thread(callback, callbackScope).resume();
- return null;
+ new JS.Thread(callback, null, args).resume();
} });
return ret;
}