views:

27

answers:

1

I am using IonicZip to compress video files and store in a blob field. I have the zip file created just need to convert it to a byte array. How is this done without writing to the harddrive?

Thanks,

Dave

+1  A: 

If you can write to a MemoryStream, you can use the "ToArray()" method on the MemoryStream to get a byte array.

Patrick Steele
How do you convert the IonicZip file that is in memory to a Memory Stream?
Most ZIP libraries have an overload of their Save method that takes a MemoryStream instead of a filename. If IonicZip provides that, simply create a new MemoryStream, pass it to the Save method then use ToArray() to get the byte array.
Patrick Steele