|
CompressionExtensionsCompress(Stream, CompressionStrength) Method
|
Compress a stream using specified compression strength.
Namespace: GSF.IO.CompressionAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.249-beta+56964f8aed6f3f2e54faec1539f7ce0ba6548fdf
Syntax<ExtensionAttribute>
Public Shared Function Compress (
source As Stream,
strength As CompressionStrength
) As MemoryStream
public:
[ExtensionAttribute]
static MemoryStream^ Compress(
Stream^ source,
CompressionStrength strength
)
[<ExtensionAttribute>]
static member Compress :
source : Stream *
strength : CompressionStrength -> MemoryStream
GSF.IO.Compression.CompressionExtensions.Compress = function(source, strength);
View SourceParameters
- source Stream
- The Stream to compress.
- strength CompressionStrength
- The CompressionStrength of the compression.
Return Value
MemoryStreamReturns a
MemoryStream of the compressed
Stream.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
This returns a memory stream of the compressed results, if the incoming stream is
very large this will consume a large amount memory. In this case use the overload
that takes the destination stream as a parameter instead.
See Also