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