# CSJ2K.j2k.entropy.encoder.MQCoder.finishLengthCalculation

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_entropy_encoder_MQCoder_finishLengthCalculation_" data-uid="CSJ2K.j2k.entropy.encoder.MQCoder.finishLengthCalculation*">finishLengthCalculation Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_entropy_encoder_MQCoder_finishLengthCalculation_" data-uid="CSJ2K.j2k.entropy.encoder.MQCoder.finishLengthCalculation*"></a>
<h4 id="CSJ2K_j2k_entropy_encoder_MQCoder_finishLengthCalculation_System_Int32___System_Int32_" data-uid="CSJ2K.j2k.entropy.encoder.MQCoder.finishLengthCalculation(System.Int32[],System.Int32)">finishLengthCalculation(int[], int)</h4>
<div class="markdown level1 summary"><p>Terminates the calculation of the required length for each coding
pass. This method must be called just after the 'terminate()' one has
been called for each terminated MQ segment.</p>
<pre><code>       &lt;p&gt;The values in 'rates' must have been compensated for any offset due
       to previous terminated segments, so that the correct index to the
       stored coded data is used.&lt;/p&gt;
</code></pre>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public virtual void finishLengthCalculation(int[] rates, int n)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overridable Sub finishLengthCalculation(rates As Integer(), n 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">rates</span></td>
      <td><p>The array containing the values returned by
'getNumCodedBytes()' for each coding pass.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">n</span></td>
      <td><p>The index in the 'rates' array of the last terminated length.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
