Compact
|
public static bool CompressPayload( this IEnumerable<CompactMeasurement> compactMeasurements, BlockAllocatedMemoryStream destination, byte compressionStrength, bool includeTime, ref DataPacketFlags flags )
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.