|
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.CompressionAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.248-beta+a497a19de709fd99e2448886199a2c8824265ddf
Syntaxpublic static int DecompressBuffer(
byte[] source,
int startIndex,
int dataLength,
int bufferLength
)
Public Shared Function DecompressBuffer (
source As Byte(),
startIndex As Integer,
dataLength As Integer,
bufferLength As Integer
) As Integer
public:
static int DecompressBuffer(
array<unsigned char>^ source,
int startIndex,
int dataLength,
int bufferLength
)
static member DecompressBuffer :
source : byte[] *
startIndex : int *
dataLength : int *
bufferLength : int -> int
GSF.IO.Compression.PatternDecompressor.DecompressBuffer = function(source, startIndex, dataLength, bufferLength);
View SourceParameters
- 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
Int32The 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.
ExceptionsException | Condition |
---|
ArgumentNullException | source buffer cannot be null. |
ArgumentOutOfRangeException | dataLength must be greater than or equal to one. |
ArgumentOutOfRangeException | bufferLength must be at least as large as dataLength. |
ArgumentOutOfRangeException | bufferLength must be at least as large as is necessary to fit the maximum possible size of the decompressed data. |
ArgumentOutOfRangeException | Actual 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