New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding callback to stream copy #2336

Merged
merged 3 commits into from Feb 17, 2018

Conversation

Projects
None yet
2 participants
@kutoman
Contributor

kutoman commented Feb 14, 2018

it's my proposal to track the stream copy progress which is useful when large files needs to be copied (e.g. when downloading big files and the progress needs to be shown to the app user).

If this gets accepted, I would suggest to also extend the linked copy methods by callback parameters

adding callback to stream copy
it's my proposal to track the stream copy progress which is useful when large files needs to be copied (e.g. when downloading big files and the progress needs to be shown to the app user)
@codenameone

This comment has been minimized.

Owner

codenameone commented Feb 14, 2018

Hi,
It's missing the Consumer interface but do you know that Codename One's streams are buffered by default and observable?

https://www.codenameone.com/javadoc/com/codename1/io/BufferedInputStream.html#setProgressListener-com.codename1.io.IOProgressListener-

@kutoman

This comment has been minimized.

Contributor

kutoman commented Feb 14, 2018

ah thanks for the hint, I didn't know that. And sorry for the Consumer interface, I defined one in my project

@codenameone

This comment has been minimized.

Owner

codenameone commented Feb 15, 2018

So do you think this PR is necessary in light of that functionality? If not feel free to close it. If you think this is still something that should be used then you would need to make it compile ;-)

kutoman added some commits Feb 15, 2018

with IOProgressListener now (should compile)
I don't put the callback explicitly in a  buffered stream and use it this way. I would need to create a BufferedInputStream and to nest the streams otherwise

@codenameone codenameone merged commit 9ec2569 into codenameone:master Feb 17, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@codenameone

This comment has been minimized.

Owner

codenameone commented Feb 17, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment