Skip to content

Use InputStream.skip to skip stream #573

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

Closed
wants to merge 2 commits into 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

@garydgregory
Copy link
Member

Closing: No reply from OP. TY @tballison for the comment and link.

@yujincheng08 yujincheng08 deleted the skip branch July 26, 2025 13:31
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.

3 participants