# CSJ2K.j2k.entropy.decoder.ByteToBitInput

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="CSJ2K_j2k_entropy_decoder_ByteToBitInput" data-uid="CSJ2K.j2k.entropy.decoder.ByteToBitInput" class="text-break">ByteToBitInput Class
</h1>
  <div class="markdown level0 summary"><p>This class provides an adapter to perform bit based input on byte based
output obejcts that inherit from a 'ByteInputBuffer' class. This class also
performs the bit unstuffing procedure specified for the 'selective
arithmetic coding bypass' mode of the JPEG 2000 entropy coder.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">ByteToBitInput</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CSJ2K.j2k.entropy.decoder.html">CSJ2K.j2k.entropy.decoder</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.ReportViewer.4.6.2.dll</h6>
  <h5 id="CSJ2K_j2k_entropy_decoder_ByteToBitInput_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class ByteToBitInput</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class ByteToBitInput</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_ByteToBitInput__ctor_CSJ2K_j2k_entropy_decoder_ByteInputBuffer_" data-uid="CSJ2K.j2k.entropy.decoder.ByteToBitInput.#ctor(CSJ2K.j2k.entropy.decoder.ByteInputBuffer)">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.ByteToBitInput.-ctor.html#CSJ2K_j2k_entropy_decoder_ByteToBitInput__ctor_CSJ2K_j2k_entropy_decoder_ByteInputBuffer_">ByteToBitInput(ByteInputBuffer)</a>
        </td>
        <td class="markdown level1 summary"><p>Instantiates a new 'ByteToBitInput' object that uses 'in' as the
underlying byte based input.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_ByteToBitInput_checkBytePadding" data-uid="CSJ2K.j2k.entropy.decoder.ByteToBitInput.checkBytePadding">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.ByteToBitInput.checkBytePadding.html#CSJ2K_j2k_entropy_decoder_ByteToBitInput_checkBytePadding">checkBytePadding()</a>
        </td>
        <td class="markdown level1 summary"><p>Checks for past errors in the decoding process by verifying the byte
padding with an alternating sequence of 0's and 1's. If an error is
detected it means that the raw bit stream has been wrongly decoded or
that the raw terminated segment length is too long. If no errors are
detected it does not necessarily mean that the raw bit stream has been
correctly decoded.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_entropy_decoder_ByteToBitInput_readBit" data-uid="CSJ2K.j2k.entropy.decoder.ByteToBitInput.readBit">
          <a class="xref" href="CSJ2K.j2k.entropy.decoder.ByteToBitInput.readBit.html#CSJ2K_j2k_entropy_decoder_ByteToBitInput_readBit">readBit()</a>
        </td>
        <td 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>
</td>
      </tr>
    </tbody>
  </table>

</div>
