|
CompactMeasurementExtensionsCompressPayload Method
|
Namespace: GSF.TimeSeries.TransportAssembly: GSF.TimeSeries (in GSF.TimeSeries.dll) Version: 2.4.248-beta
SyntaxGSF.TimeSeries.Transport.CompactMeasurementExtensions.CompressPayload = function(compactMeasurements, destination, compressionStrength, includeTime, flags);
View SourceParameters
- compactMeasurements IEnumerableCompactMeasurement
- Payload of CompactMeasurement values.
- destination BlockAllocatedMemoryStream
- Memory based destination stream to hold compressed payload.
- compressionStrength Byte
- Compression strength to use.
- includeTime Boolean
- Flag that determines if time should be included in the compressed payload.
- flags DataPacketFlags
- Current DataPacketFlags.
Return Value
Booleantrue if payload was compressed and encoded onto
destination stream; otherwise
false.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableCompactMeasurement. 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
Compressed payload will only be encoded onto destination stream if compressed size would be smaller
than normal serialized size.
As an optimization this function uses a compression method that uses pointers to native structures, as such the
endian order encoding of the compressed data will always be in the native-endian order of the operating system.
This will be an important consideration when writing a endian order neutral payload decompressor. To help with
this the actual endian order used during compression is marked in the data flags. However, measurements values
are consistently encoded in big-endian order prior to buffer compression.
See Also