Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposed)
            {
                if (disposing)
                {
                    if (ZipStream != null)
                    {
                        ZipStream.Dispose();
                    }
                }
            }

            disposed = true;
        }