Blast.Blast.Blast C# (CSharp) Method

Blast() public method

Decompress input to output using the provided infun() and outfun() calls. On success, the return value of blast() is zero. If there is an error in the source data, i.e. it is not in the proper format, then a negative value is returned. If there is not enough input available or there is not enough output space, then a positive error is returned.

The input function is invoked: len = infun(how, &buf), where buf is set by infun() to point to the input buffer, and infun() returns the number of available bytes there. If infun() returns zero, then blast() returns with an input error. (blast() only asks for input if it needs it.) inhow is for use by the application to pass an input descriptor to infun(), if desired.

The output function is invoked: err = outfun(how, buf, len), where the bytes to be written are buf[0..len-1]. If err is not zero, then blast() returns with an output error. outfun() is always called with len <= 4096. outhow is for use by the application to pass an output descriptor to outfun(), if desired.

The return codes are:

2: ran out of input before completing decompression 1: output error before completing decompression 0: successful decompression -1: literal flag not zero or one -2: dictionary size not in 4..6 -3: distance is too far back

At the bottom of blast.c is an example program that uses blast() that can be compiled to produce a command-line decompression filter by defining TEST.

public Blast ( Stream inputStream, Stream outputStream ) : System
inputStream Stream
outputStream Stream
return System
        public Blast(Stream inputStream, Stream outputStream)
        {
            this._inputStream = inputStream;
            this._outputStream = outputStream;
        }