Click or drag to resize

PatternDecompressorDecompressBuffer Method

Decompress a byte array containing a sequential list of compressed 32-bit structures (e.g., floating point numbers, integers or unsigned integers) using a patterned compression method.

Namespace: GSF.IO.Compression
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public static int DecompressBuffer(
	byte[] source,
	int startIndex,
	int dataLength,
	int bufferLength
)
View Source

Parameters

source  Byte
The Byte array containing compressed 32-bit values to be decompressed. Decompression 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 large enough to fit the maximum size of the decompressed data. See MaximumSizeDecompressed(Int32).

Return Value

Int32
The new length of the buffer after compression, unless the data cannot be compressed. If the data cannot be compressed, the buffer will remain unchanged and zero will be returned.
Exceptions
ExceptionCondition
ArgumentNullExceptionsource buffer cannot be null.
ArgumentOutOfRangeExceptiondataLength must be greater than or equal to one.
ArgumentOutOfRangeExceptionbufferLength must be at least as large as dataLength.
ArgumentOutOfRangeExceptionbufferLength must be at least as large as is necessary to fit the maximum possible size of the decompressed data.
ArgumentOutOfRangeExceptionActual length of source buffer is less than specified bufferLength.
Remarks

Decompression is performed inline. The source buffer must be large enough to contain the maximum possible size of the decompressed buffer. This maximum size can be obtained by using the MaximumSizeDecompressed(Int32) method.

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