Skip to content

Provide direct InputStream of ZIP entries#2509

Merged
skylot merged 2 commits intoskylot:masterfrom
jpstotz:stream
May 24, 2025
Merged

Provide direct InputStream of ZIP entries#2509
skylot merged 2 commits intoskylot:masterfrom
jpstotz:stream

Conversation

@jpstotz
Copy link
Copy Markdown
Collaborator

@jpstotz jpstotz commented May 24, 2025

As mentioned recently there was no direct way of getting an InputStream of a ZIP entry without having to extract the full entry data to a byte array in memory.

This PR provides a way to directly get an InputStream for compressed and uncompressed data in a ZIP file.
Only in one case the only way of reading everything to memory is still present: when using the FallbackZipParser.

@skylot
Copy link
Copy Markdown
Owner

skylot commented May 24, 2025

@jpstotz thanks for implementation 👍
Although I apply some changes:

  • use LimitedInputStream if security settings suggest so
  • for getBytes method use previous implementation without converting to input stream, additional conversion looks unnecessary.

@skylot skylot merged commit b6f27d8 into skylot:master May 24, 2025
4 checks passed
@jpstotz jpstotz deleted the stream branch June 21, 2025 09:07
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