Example #1
0
 public void Finish()
 {
     if (!ZipStream.IsFinished)
     {
         ZipStream.Finish();
     }
 }
Example #2
0
        public byte[] AsByteArray()
        {
            // we're gonna close out the zip stream,
            // but we want the underlying memory stream open so we can get its bytes!
            ZipStream.IsStreamOwner = false; // leave the memory stream open
            ZipStream.Finish();

            var result = DataStream.ToArray();

            ZipStream.Dispose();
            return(result);
        }