Exemplo n.º 1
0
 public static Stream DecompressStream(ITransportHeaders header, Stream stream)
 {
     if (_IsStreamCompressed(header))
     {
         return(CompressHelper.DecompressStream(stream));
     }
     else
     {
         return(stream);
     }
 }
Exemplo n.º 2
0
 public static Stream CompressStream(ITransportHeaders header, Stream stream)
 {
     //	大于一定的大小才进行压缩
     if (stream.Length >= CompressBaseSize)
     {
         header[CompressSinkHelper.CompressedFlag] = Boolean.TrueString;
         return(CompressHelper.CompressStream(stream));
     }
     else
     {
         return(stream);
     }
 }