url - In Java, how do I set a progress bar for FileChannel? -


for example,

channels.newchannel(url.openstream());

this 1 line opens stream , gets data it, there no way can find progress it.

is there way so?

this 1 line opens stream , gets data it

no, won't until .read() it. therefore...

is there way so?

yes there is. .read(buf) buf bytebuffer.

just grab buffer's .position().

(and note channels.newchannel(inputstream) not return filechannel readablebytechannel)


Comments