Exemplo n.º 1
0
 public void Test()
 {
     using (MemoryStream Stream1 = new MemoryStream())
     {
         using (Utilities.Web.Streams.UglyStream StreamUsing = new Utilities.Web.Streams.UglyStream(Stream1, Utilities.IO.CompressionType.GZip))
         {
             StreamUsing.Write("This is a test".ToByteArray(), 0, "This is a test".ToByteArray().Length);
             StreamUsing.Flush();
         }
         Assert.Equal("This is a test", Stream1.ReadAllBinary().ToString(Base64FormattingOptions.None).Decompress(CompressionType: Utilities.IO.CompressionType.GZip));
     }
 }
 public void Test()
 {
     using (MemoryStream Stream1 = new MemoryStream())
     {
         using (Utilities.Web.Streams.UglyStream StreamUsing = new Utilities.Web.Streams.UglyStream(Stream1, Utilities.IO.CompressionType.GZip))
         {
             StreamUsing.Write("This is a test".ToByteArray(), 0, "This is a test".ToByteArray().Length);
             StreamUsing.Flush();
         }
         Assert.Equal("This is a test", Stream1.ReadAllBinary().ToString(Base64FormattingOptions.None).Decompress(CompressionType: Utilities.IO.CompressionType.GZip));
     }
 }