# C1.Zip.ZLib.ZStream.inflate

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Zip_ZLib_ZStream_inflate_" data-uid="C1.Zip.ZLib.ZStream.inflate*">inflate Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Zip_ZLib_ZStream_inflate_" data-uid="C1.Zip.ZLib.ZStream.inflate*"></a>
<h4 id="C1_Zip_ZLib_ZStream_inflate_System_Int32_" data-uid="C1.Zip.ZLib.ZStream.inflate(System.Int32)">inflate(int)</h4>
<div class="markdown level1 summary"><p>Decompresses as much data as possible until the input buffer is exhausted or
the output buffer is full.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int inflate(int flush)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function inflate(flush 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.int32">int</a></td>
      <td><span class="parametername">flush</span></td>
      <td><p>How to flush data into the output buffer (default value is 2).</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><b>Z_OK</b> if some progress has been made (more input processed or more output produced),
<b>Z_STREAM_END</b> if the end of the compressed data has been reached and all
uncompressed output has been produced,
<b>Z_NEED_DICT</b> if a preset dictionary is needed at this point,
<b>Z_DATA_ERROR</b> if the input data was corrupted (input stream not conforming to
the zlib format or incorrect checksum),
<b>Z_STREAM_ERROR</b> if the stream structure was inconsistent (for example if
<b>next_in</b> or <b>next_out</b> was null),
<b>Z_MEM_ERROR</b> if there was not enough memory,
<b>Z_BUF_ERROR</b> if no progress is possible or if there was not enough room in the
output buffer when <b>Z_FINISH</b> is used.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Zip_ZLib_ZStream_inflate_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p><b>inflate</b> performs one or both of the following actions:</p>
<p>1. Decompress more input starting at <b>next_in</b> and update <b>next_in</b>
and <b>avail_in</b> accordingly. If not all input can be processed (because there 
is not enough room in the output buffer), <b>next_in</b> is updated and processing 
will resume at this point for the next call to inflate.</p>
<p>2. Provide more output starting at <b>next_out</b> and update <b>next_out</b>
and <b>avail_out</b> accordingly. <b>inflate</b> provides as much output as 
possible, until there is no more input data or no more space in the output buffer.</p>
<p>Before the call to inflate, the application should ensure that at least one of the 
actions is possible, by providing more input and/or consuming more output, and 
updating the <b>next_*</b> and <b>avail_*</b> values accordingly.</p>
<p>If <b>inflate</b> returns Zero and <b>avail_out</b> == 0, it must be called again 
after making room in the output buffer because there might be more output pending.</p>
<p>The application can consume the uncompressed output when it wants, for example when 
the output buffer is full (<b>avail_out</b> == 0), or after each call of <b>inflate</b>.</p>
<p>This method may introduce some output latency (reading input without producing 
any output) except when forced to flush.</p>
</div>
</div>
