# CSJ2K.j2k.entropy.encoder.MQCoder.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_entropy_encoder_MQCoder__ctor_" data-uid="CSJ2K.j2k.entropy.encoder.MQCoder.#ctor*">MQCoder Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_entropy_encoder_MQCoder__ctor_" data-uid="CSJ2K.j2k.entropy.encoder.MQCoder.#ctor*"></a>
<h4 id="CSJ2K_j2k_entropy_encoder_MQCoder__ctor_CSJ2K_j2k_entropy_encoder_ByteOutputBuffer_System_Int32_System_Int32___" data-uid="CSJ2K.j2k.entropy.encoder.MQCoder.#ctor(CSJ2K.j2k.entropy.encoder.ByteOutputBuffer,System.Int32,System.Int32[])">MQCoder(ByteOutputBuffer, int, int[])</h4>
<div class="markdown level1 summary"><p>Instantiates a new MQ-coder, with the specified number of contexts and
initial states. The compressed bytestream is written to the 'oStream'
object.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public MQCoder(ByteOutputBuffer oStream, int nrOfContexts, int[] init)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(oStream As ByteOutputBuffer, nrOfContexts As Integer, init 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.encoder.ByteOutputBuffer.html">ByteOutputBuffer</a></td>
      <td><span class="parametername">oStream</span></td>
      <td><p>where to output the compressed data.</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 by the MQ coder.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</td>
      <td><span class="parametername">init</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>
