# CSJ2K.j2k.entropy.decoder.ByteToBitInput.readBit

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_entropy_decoder_ByteToBitInput_readBit_" data-uid="CSJ2K.j2k.entropy.decoder.ByteToBitInput.readBit*">readBit Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_entropy_decoder_ByteToBitInput_readBit_" data-uid="CSJ2K.j2k.entropy.decoder.ByteToBitInput.readBit*"></a>
<h4 id="CSJ2K_j2k_entropy_decoder_ByteToBitInput_readBit" data-uid="CSJ2K.j2k.entropy.decoder.ByteToBitInput.readBit">readBit()</h4>
<div class="markdown level1 summary"><p>Reads from the bit stream one bit. If 'bpos' is -1 then a byte is read
and loaded into the bit buffer, from where the bit is read. If
necessary the bit unstuffing will be applied.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public int readBit()</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function readBit() As Integer</code></pre>
</div>
<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>The read bit (0 or 1).</p>
</td>
    </tr>
  </tbody>
</table>
</div>
