public void Finish() { if (!ZipStream.IsFinished) { ZipStream.Finish(); } }
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); }