private static Stream GetCompressStream() { var stream = OrginolStream(); var compressStream = CompressManager.CompressStream(stream); return(compressStream); }
private static byte[] GetCompressedStream(string sourceText, Encoding encoding) { using (MemoryStream ms = new MemoryStream()) { using (StreamWriter writer = new StreamWriter(ms, encoding)) { writer.Write(sourceText); writer.Flush(); ms.Seek(0, SeekOrigin.Begin); MemoryStream compressedStream = (MemoryStream)CompressManager.CompressStream(ms); return(compressedStream.ToArray()); } } }