# C1.Zip.ZLib.ZStream.deflateSetDictionary

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Zip_ZLib_ZStream_deflateSetDictionary_" data-uid="C1.Zip.ZLib.ZStream.deflateSetDictionary*">deflateSetDictionary Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Zip_ZLib_ZStream_deflateSetDictionary_" data-uid="C1.Zip.ZLib.ZStream.deflateSetDictionary*"></a>
<h4 id="C1_Zip_ZLib_ZStream_deflateSetDictionary_System_Byte___System_Int32_" data-uid="C1.Zip.ZLib.ZStream.deflateSetDictionary(System.Byte[],System.Int32)">deflateSetDictionary(byte[], int)</h4>
<div class="markdown level1 summary"><p>Initializes the compression dictionary from the given byte sequence without
producing any compressed output.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int deflateSetDictionary(byte[] dictionary, int dictLength)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function deflateSetDictionary(dictionary As Byte(), dictLength As Integer) As Integer</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</td>
      <td><span class="parametername">dictionary</span></td>
      <td><p>Data in the dictionary.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">dictLength</span></td>
      <td><p>Number of bytes in the dictionary.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><p>Zero on success, an error code on failure.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Zip_ZLib_ZStream_deflateSetDictionary_System_Byte___System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This method must be called immediately after <a class="xref" href="C1.Zip.ZLib.ZStream.deflateInit.html#C1_Zip_ZLib_ZStream_deflateInit_System_Int32_">deflateInit(int)</a>,
before any call to <a class="xref" href="C1.Zip.ZLib.ZStream.deflate.html#C1_Zip_ZLib_ZStream_deflate_System_Int32_">deflate(int)</a>.</p>
<p>The compressor and decompressor must use exactly the same dictionary 
(see <a class="xref" href="C1.Zip.ZLib.ZStream.inflateSetDictionary.html#C1_Zip_ZLib_ZStream_inflateSetDictionary_System_Byte___System_Int32_">inflateSetDictionary(byte[], int)</a>).</p>
</div>
</div>
