/// <summary> /// Set the dictionary to be used for either Inflation or Deflation. /// </summary> /// <param name="dictionary">The dictionary bytes to use.</param> /// <returns>Z_OK if all goes well.</returns> public int SetDictionary(byte[] dictionary) { if (istate != null) { return(istate.SetDictionary(dictionary)); } if (dstate != null) { return(dstate.SetDictionary(dictionary)); } throw new ZlibException("No Inflate or Deflate state!"); }
/// <summary> /// 设置压缩时的字典。 /// </summary> /// <param name="dictionary">字典。</param> /// <returns>如果正常返回 ZlibState.Success 。</returns> public ZlibState SetDictionary(byte[] dictionary) { if (IState != null) { return(IState.SetDictionary(dictionary)); } if (DState != null) { return(DState.SetDictionary(dictionary)); } throw new ZlibException("没有初始化 Inflate 或 Deflate 状态 。"); }