/// <summary> /// Compresses the <paramref name="source"/> stream using the specified <paramref name="compressionType"/> algorithm. /// </summary> /// <param name="source">The source stream to compress.</param> /// <param name="compressionType">The compression algorithm to use for the compression.</param> /// <param name="bufferSize">The size of the buffer. This value must be greater than zero. The default size is 2048.</param> /// <returns>A compressed <see cref="System.IO.Stream"/> of the <paramref name="source"/>.</returns> public static Stream Compress(this Stream source, CompressionType compressionType, int bufferSize) { return(CompressionUtility.CompressStream(source, compressionType, bufferSize)); }
/// <summary> /// Compresses the <paramref name="source"/> stream using the Deflate algorithm. /// </summary> /// <param name="source">The source stream to compress.</param> /// <returns>A compressed <see cref="System.IO.Stream"/> of the <paramref name="source"/>.</returns> public static Stream Compress(this Stream source) { return(CompressionUtility.CompressStream(source)); }