# CSJ2K.j2k.codestream.reader.PktDecoder

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="CSJ2K_j2k_codestream_reader_PktDecoder" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder" class="text-break">PktDecoder Class
</h1>
  <div class="markdown level0 summary"><p>This class is used to read packet's head and body. All the members must be
re-initialized at the beginning of each tile thanks to the restart()
method.</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">PktDecoder</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CSJ2K.j2k.codestream.reader.html">CSJ2K.j2k.codestream.reader</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.ReportViewer.4.6.2.dll</h6>
  <h5 id="CSJ2K_j2k_codestream_reader_PktDecoder_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class PktDecoder</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class PktDecoder</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_codestream_reader_PktDecoder__ctor_CSJ2K_j2k_decoder_DecoderSpecs_CSJ2K_j2k_codestream_reader_HeaderDecoder_CSJ2K_j2k_io_RandomAccessIO_CSJ2K_j2k_codestream_reader_BitstreamReaderAgent_System_Boolean_System_Int32_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.#ctor(CSJ2K.j2k.decoder.DecoderSpecs,CSJ2K.j2k.codestream.reader.HeaderDecoder,CSJ2K.j2k.io.RandomAccessIO,CSJ2K.j2k.codestream.reader.BitstreamReaderAgent,System.Boolean,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.-ctor.html#CSJ2K_j2k_codestream_reader_PktDecoder__ctor_CSJ2K_j2k_decoder_DecoderSpecs_CSJ2K_j2k_codestream_reader_HeaderDecoder_CSJ2K_j2k_io_RandomAccessIO_CSJ2K_j2k_codestream_reader_BitstreamReaderAgent_System_Boolean_System_Int32_">PktDecoder(DecoderSpecs, HeaderDecoder, RandomAccessIO, BitstreamReaderAgent, bool, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates an empty PktDecoder object associated with given decoder
specifications and HeaderDecoder. This object must be initialized
thanks to the restart method before being used.</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_codestream_reader_PktDecoder_getNumPrecinct_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.getNumPrecinct(System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.getNumPrecinct.html#CSJ2K_j2k_codestream_reader_PktDecoder_getNumPrecinct_System_Int32_System_Int32_">getNumPrecinct(int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the number of precincts in a given component and resolution level.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_getPPX_System_Int32_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.getPPX(System.Int32,System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.getPPX.html#CSJ2K_j2k_codestream_reader_PktDecoder_getPPX_System_Int32_System_Int32_System_Int32_">getPPX(int, int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the precinct partition width for the specified component,
resolution level and tile.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_getPPY_System_Int32_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.getPPY(System.Int32,System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.getPPY.html#CSJ2K_j2k_codestream_reader_PktDecoder_getPPY_System_Int32_System_Int32_System_Int32_">getPPY(int, int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the precinct partition height for the specified component,
resolution level and tile.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_getPrecInfo_System_Int32_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.getPrecInfo(System.Int32,System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.getPrecInfo.html#CSJ2K_j2k_codestream_reader_PktDecoder_getPrecInfo_System_Int32_System_Int32_System_Int32_">getPrecInfo(int, int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Get PrecInfo instance of the specified resolution level, component and
precinct.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_readEPHMarker_CSJ2K_j2k_codestream_reader_PktHeaderBitReader_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.readEPHMarker(CSJ2K.j2k.codestream.reader.PktHeaderBitReader)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.readEPHMarker.html#CSJ2K_j2k_codestream_reader_PktDecoder_readEPHMarker_CSJ2K_j2k_codestream_reader_PktHeaderBitReader_">readEPHMarker(PktHeaderBitReader)</a>
        </td>
        <td class="markdown level1 summary"><p>Try to read an EPH marker. If it is not possible then an Error is
thrown.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_readPktBody_System_Int32_System_Int32_System_Int32_System_Int32_CSJ2K_j2k_codestream_reader_CBlkInfo_______System_Int32___" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.readPktBody(System.Int32,System.Int32,System.Int32,System.Int32,CSJ2K.j2k.codestream.reader.CBlkInfo[][][],System.Int32[])">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.readPktBody.html#CSJ2K_j2k_codestream_reader_PktDecoder_readPktBody_System_Int32_System_Int32_System_Int32_System_Int32_CSJ2K_j2k_codestream_reader_CBlkInfo_______System_Int32___">readPktBody(int, int, int, int, CBlkInfo[][][], int[])</a>
        </td>
        <td class="markdown level1 summary"><p>Reads specificied packet body in order to find offset of each
code-block's piece of codeword. This use the list of found code-blocks
in previous red packet head.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_readPktHead_System_Int32_System_Int32_System_Int32_System_Int32_CSJ2K_j2k_codestream_reader_CBlkInfo_______System_Int32___" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.readPktHead(System.Int32,System.Int32,System.Int32,System.Int32,CSJ2K.j2k.codestream.reader.CBlkInfo[][][],System.Int32[])">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.readPktHead.html#CSJ2K_j2k_codestream_reader_PktDecoder_readPktHead_System_Int32_System_Int32_System_Int32_System_Int32_CSJ2K_j2k_codestream_reader_CBlkInfo_______System_Int32___">readPktHead(int, int, int, int, CBlkInfo[][][], int[])</a>
        </td>
        <td class="markdown level1 summary"><p>Read specified packet head and found length of each code-block's piece
of codewords as well as number of skipped most significant bit-planes.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_readSOPMarker_System_Int32___System_Int32_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.readSOPMarker(System.Int32[],System.Int32,System.Int32,System.Int32)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.readSOPMarker.html#CSJ2K_j2k_codestream_reader_PktDecoder_readSOPMarker_System_Int32___System_Int32_System_Int32_System_Int32_">readSOPMarker(int[], int, int, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Try to read a SOP marker and check that its sequence number if not out
of sequence. If so, an error is thrown.</p>
</td>
      </tr>
      <tr>
        <td id="CSJ2K_j2k_codestream_reader_PktDecoder_restart_System_Int32_System_Int32___System_Int32_CSJ2K_j2k_codestream_reader_CBlkInfo___________System_Boolean_System_IO_MemoryStream_" data-uid="CSJ2K.j2k.codestream.reader.PktDecoder.restart(System.Int32,System.Int32[],System.Int32,CSJ2K.j2k.codestream.reader.CBlkInfo[][][][][],System.Boolean,System.IO.MemoryStream)">
          <a class="xref" href="CSJ2K.j2k.codestream.reader.PktDecoder.restart.html#CSJ2K_j2k_codestream_reader_PktDecoder_restart_System_Int32_System_Int32___System_Int32_CSJ2K_j2k_codestream_reader_CBlkInfo___________System_Boolean_System_IO_MemoryStream_">restart(int, int[], int, CBlkInfo[][][][][], bool, MemoryStream)</a>
        </td>
        <td class="markdown level1 summary"><p>Re-initialize the PktDecoder instance at the beginning of a new tile.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
