Ionic zip allows me to add existing file to zip object and create a zip file. But considering that I am reading those byte[] from created zip file and sending over server, I need to again create zip file from that byte[] to store zip on server. How do I achieve this ?
I am using C#.
If I understand your question correctly, you get your
byte[]
data array over the network and want to save that data in a zip file? You can create a newZipEntry
from aMemoryStream
which you create from thebyte[]
you got (as shown in the docs):It's not really clear from your question what you're doing - but if you're just trying to avoid saving to disk and then reloading to get the data, just save to a
MemoryStream
:Alternatively, use
MemoryStream.GetBuffer()
to avoid making another copy: