Exemple #1
0
 /// <summary>
 /// Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of <see cref="inflate" /> if this call returned <see cref="ZLibResultCode.Z_NEED_DICT" />. The dictionary chosen by the compressor can be determined from the Adler32 value returned by this call of <see cref="inflate" />. The compressor and decompresser must use exactly the same dictionary.
 /// </summary>
 /// <param name="dictionary">A byte array - a dictionary.</param>
 /// <param name="dictLength">The length of the dictionary.</param>
 /// <returns>
 /// inflateSetDictionary returns <see cref="ZLibResultCode.Z_OK" /> if success, <see cref="ZLibResultCode.Z_STREAM_ERROR" /> if a parameter is invalid (such as <c>null</c> dictionary) or the stream state is inconsistent, <see cref="ZLibResultCode.Z_DATA_ERROR" /> if the given dictionary doesn't match the expected one (incorrect Adler32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of <see cref="inflate" />.
 /// </returns>
 internal int inflateSetDictionary(byte[] dictionary, int dictLength)
 {
     if (_istate == null)
     {
         return((int)ZLibResultCode.Z_STREAM_ERROR);
     }
     return(_istate.inflateSetDictionary(this, dictionary, dictLength));
 }