|
PatternCompressorCompressBuffer Method
|
Compress a byte array containing a sequential list of 32-bit structures (e.g., floating point numbers, integers or unsigned integers) using a patterned compression method.
Namespace: GSF.IO.CompressionAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.205-beta+5ef4169f3b1079d8b163dd363614f656bd140924
Syntax public static int CompressBuffer(
byte[] source,
int startIndex,
int dataLength,
int bufferLength,
byte compressionStrength = 5
)
Public Shared Function CompressBuffer (
source As Byte(),
startIndex As Integer,
dataLength As Integer,
bufferLength As Integer,
Optional compressionStrength As Byte = 5
) As Integer
static member CompressBuffer :
source : byte[] *
startIndex : int *
dataLength : int *
bufferLength : int *
?compressionStrength : byte
(* Defaults:
let _compressionStrength = defaultArg compressionStrength 5
*)
-> int
GSF.IO.Compression.PatternCompressor.CompressBuffer = function(source, startIndex, dataLength, bufferLength, compressionStrength);
View SourceParameters
- source Byte
- The Byte array containing 32-bit values to compress. Compression will happen inline on this buffer.
- startIndex Int32
- An Int32 representing the start index of the byte array.
- dataLength Int32
- The number of bytes in the buffer that represents actual data.
- bufferLength Int32
- The number of bytes available for use in the buffer; actual buffer length must be at least one byte larger than dataLength since it's possible that data cannot be compressed. This extra byte will be used indicate an uncompressed buffer.
- compressionStrength Byte (Optional)
- Specifies compression strength (0 to 31). Smaller numbers will run faster, larger numbers will yield better compression.
Return Value
Int32The new length of the buffer after compression.
Exceptions Remarks
As an optimization this function is using pointers to native structures, as such the endian order decoding and encoding of the values will always be in the native endian order of the operating system.
See Also