Skip to content
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

Use InputStream.skip to skip stream #573

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yujincheng08
Copy link
Contributor

This can avoid unexpected IO when using InputStream that implements skip

This can avoid unexpected IO when using InputStream that implements skip
@tballison
Copy link
Contributor

tballison commented Oct 31, 2024

InputStream.skip() is dangerous, especially on FileInputStreams -- cf. commons-io's IOUtils use of read() under its skipFully().

For kicks, I just confirmed that the javadocs for 21 still have FileInputStream's skip() as extremely fiddly. There be dragons.

https://issues.apache.org/jira/browse/IO-203?focusedCommentId=12842641&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12842641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants