public HeaderDecoder(RandomAccessIO ehs, ParameterList pl, HeaderInfo hi)
{
this.hi = hi;
// CONVERSION PROBLEM?
//this.verbose = verbose;
pl.checkList(OPT_PREFIX, ParameterList.toNameArray(pinfo));
mainHeadOff = ehs.Pos;
if (((short) ehs.readShort()) != CSJ2K.j2k.codestream.Markers.SOC)
{
throw new CorruptedCodestreamException("SOC marker segment not " + " found at the " + "beginning of the " + "codestream.");
}
// First Pass: Decode and store main header information until the SOT
// marker segment is found
nfMarkSeg = 0;
do
{
extractMainMarkSeg(ehs.readShort(), ehs);
}
while ((nfMarkSeg & SOT_FOUND) == 0); //Stop when SOT is found
ehs.seek(ehs.Pos - 2); // Realign codestream on SOT marker
// Second pass: Read each marker segment previously found
readFoundMainMarkSeg();
}