J.Joe
J.Joe

Reputation: 81

Java IO . How to make file to zip file byte[]?

I want to make the file to zip . I can make the file to zip file but I don't want to create temporary zip file. Is any way to make the file to zip and to byte[] ? Thanks

Upvotes: 0

Views: 44

Answers (1)

Senthil
Senthil

Reputation: 2246

zip files are typically generated with streams anyway, so there's no need to temporarily store them in a file - might as well be in memory or streamed directly to a remote recipient (with only a small memory buffer to avoid a large memory footprint). Ref Sample helperclass in the accepted answer section How can I generate zip file without saving to the disk with Java?

Upvotes: 1

Related Questions