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

LZ4FrameInputStream should read InputStream lazily #146

Closed
bjmi opened this issue Sep 13, 2019 · 1 comment
Closed

LZ4FrameInputStream should read InputStream lazily #146

bjmi opened this issue Sep 13, 2019 · 1 comment

Comments

@bjmi
Copy link

bjmi commented Sep 13, 2019

Creating a new LZ4FrameInputStream instance already reads the underlying InputStream by calling nextFrameInfo().
This call should be deferred until an actual read(...) is performed i.e. separate instance creation and utilization.

Advantages

  • If input is never read or used no resources or handles would be allocated.
  • My use-case: underlying InputStream is not ready when creating LZ4FrameInputStream but actually is when used.
@odaira
Copy link
Member

odaira commented Jul 30, 2020

Fixed by 5e23573. Instance creation of LZ4FrameInputStream becomes 300x faster. Thanks for your suggestion!

@odaira odaira closed this as completed Jul 30, 2020
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

No branches or pull requests

2 participants