HP LoadRunner Protocol SDK Test Run API Reference
12.02
|
This file contains declarations of compression utilities. More...
Go to the source code of this file.
Enumerations | |
enum | COMPRESSION_TYPE { GZIP_COMPRESSION_TYPE, DEFLATE_COMPRESSION_TYPE } |
Compression algorithms. More... | |
Functions | |
void UTILITIES_DECLSPEC | CompressBuffer (COMPRESSION_TYPE mCompressionType, const char *mInputBuffer, size_t mInputBufferSize, char *mCompressedBuffer, size_t mCompressedBufferSize, size_t *mCompressedBodyUsedBytes) |
Compresses the input buffer using the specified compression method. More... | |
bool UTILITIES_DECLSPEC | DecompressBuffer (COMPRESSION_TYPE mCompressionType, const char *mInputBuffer, size_t mInputBufferSize, char *mDecompressedBuffer, size_t mDecompressedBufferSize, size_t *mDecompressedBodyUsedBytes, size_t *mInputBufferUsedBytes) |
Decompresses the input buffer using the specified decompression method. More... | |
This file contains declarations of compression utilities.
enum COMPRESSION_TYPE |
void UTILITIES_DECLSPEC CompressBuffer | ( | COMPRESSION_TYPE | mCompressionType, |
const char * | mInputBuffer, | ||
size_t | mInputBufferSize, | ||
char * | mCompressedBuffer, | ||
size_t | mCompressedBufferSize, | ||
size_t * | mCompressedBodyUsedBytes | ||
) |
Compresses the input buffer using the specified compression method.
mCompressedBuffer
must be large enough to hold all compressed data.
For deflate compression, the destination buffer size (mCompressedBufferSize
) must be at least 0.1% larger than mInputBufferSize
+ 12 bytes.
For gzip, add 20 bytes to the mCompressedBufferSize
for the gzip header.
mCompressionType | Compression type (gzip or deflate) |
mInputBuffer | Input buffer contains uncompressed data |
mInputBufferSize | The number of bytes to compress |
mCompressedBuffer | Output buffer for compressed data |
mCompressedBufferSize | Capacity of mCompressedBuffer |
mCompressedBodyUsedBytes | Count of compressed bytes written to output buffer |
bool UTILITIES_DECLSPEC DecompressBuffer | ( | COMPRESSION_TYPE | mCompressionType, |
const char * | mInputBuffer, | ||
size_t | mInputBufferSize, | ||
char * | mDecompressedBuffer, | ||
size_t | mDecompressedBufferSize, | ||
size_t * | mDecompressedBodyUsedBytes, | ||
size_t * | mInputBufferUsedBytes | ||
) |
Decompresses the input buffer using the specified decompression method.
DecompressBuffer
can be called repeatedly to process a large buffer in stages.
On each invocation, the function decompresses as much data as possible. It stops when the input buffer is empty or the output buffer is full.
mCompressionType | Compression type (gzip or deflate) |
mInputBuffer | Input buffer contains compressed data |
mInputBufferSize | The number of bytes to decompress |
mDecompressedBuffer | Output buffer for uncompressed data |
mDecompressedBufferSize | Capacity of mDecompressedBuffer |
mDecompressedBodyUsedBytes | Count of decompressed bytes written to output buffer |
mInputBufferUsedBytes | Count of bytes from the input buffer that were decompressed |