zip4j icon indicating copy to clipboard operation
zip4j copied to clipboard

FEATURE REQUEST: Create a ZipFile with in memory content.

Open ndtreviv opened this issue 2 years ago • 1 comments
trafficstars

I have a byte[] which is zip content. I want to identify if it's encrypted, and if so apply a password and extract all the contents.

At the moment I'd have to stream this to disk and then create a ZipFile. Or I have to create a ZipInputStream, iterate over the LocalFileHeaders and find out of they're encrypted before applying the password.

I don't want to touch the disk, basically.

Ideally I'd be able to create a ZipFile from a byte[] or InputStream, then I can call isEncrypted(), conditionally apply the password and extract the contents.

ndtreviv avatar Jun 30 '23 12:06 ndtreviv

I ran into the same issue - I need to stream small zip files, repackage and push them, but need to have everything done in memory.

Had to resort to using native java zip capabilities, but it's not as clean as this library and simply thongs like editing zip entry names seem unnecessarily complicated.

Would really prefer using zip4j.

skyhirider avatar Jul 28 '23 09:07 skyhirider