# CSJ2K.j2k.entropy.decoder.MQDecoder.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_entropy_decoder_MQDecoder__ctor_" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.#ctor*">MQDecoder Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_entropy_decoder_MQDecoder__ctor_" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.#ctor*"></a>
<h4 id="CSJ2K_j2k_entropy_decoder_MQDecoder__ctor_CSJ2K_j2k_entropy_decoder_ByteInputBuffer_System_Int32_System_Int32___" data-uid="CSJ2K.j2k.entropy.decoder.MQDecoder.#ctor(CSJ2K.j2k.entropy.decoder.ByteInputBuffer,System.Int32,System.Int32[])">MQDecoder(ByteInputBuffer, int, int[])</h4>
<div class="markdown level1 summary"><p>Instantiates a new MQ-decoder, with the specified number of contexts
and initial states. The compressed bytestream is read from the
'iStream' object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public MQDecoder(ByteInputBuffer iStream, int nrOfContexts, int[] initStates)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(iStream As ByteInputBuffer, nrOfContexts As Integer, initStates 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="CSJ2K.j2k.entropy.decoder.ByteInputBuffer.html">ByteInputBuffer</a></td>
      <td><span class="parametername">iStream</span></td>
      <td><p>the stream that contains the coded bits</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">nrOfContexts</span></td>
      <td><p>The number of contexts used</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</td>
      <td><span class="parametername">initStates</span></td>
      <td><p>The initial state for each context. A reference is
kept to this array to reinitialize the contexts whenever 'reset()' or
'resetCtxts()' is called.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
