ExpandBuffer Method  
 

Expand the contents of the specified string or byte array.

Syntax

object.ExpandBuffer( InputBuffer, OutputBuffer )

Parameters

InputBuffer
A string or byte array that contains the data to be expanded.
OutputBuffer
A string or byte array that is passed by reference and will contain the expanded data when the method returns.

Return Value

This method returns the number of bytes of expanded data that was copied into the output buffer. If the input buffer is a zero-length string or an empty array, the method will return zero. If an error occurs, the method will return -1. Check the value of the LastError property to determine the specific error that has occurred.

Remarks

The ExpandBuffer method expands data that compressed with a previous call to the CompressBuffer method. If the input buffer is a string of base64 encoded data, it will automatically be decoded prior to being expanded. If the expanded (uncompressed) data is textual, then the output buffer can be a string or variant type. If the expanded data is binary, the output buffer should always be a byte array. Binary data that is expanded into a string buffer may be corrupted because the data will be automatically be converted to Unicode by this method. This conversion is not performed if the output buffer is a byte array. If the caller specifies a fixed-size byte array as the output buffer, the array must be large enough to contain all of the expanded data, otherwise the method will fail.

The return value from this method should always be checked to ensure that the data was successfully expanded. An application should never assume that the output buffer contains valid data unless the return value is greater than zero.

See Also

CompressBuffer Method, CompressFile Method, ExpandFile Method