System.out.println("==== Segments ====");
boolean finished = false;
while (!reader.isFinished() && !finished) {
SegmentHeader segmentHeader = new SegmentHeader();
if (JBIG2StreamDecoder.debug)
System.out.println("==== Segment Header ====");
readSegmentHeader(segmentHeader);
// read the Segment data
Segment segment = null;
int segmentType = segmentHeader.getSegmentType();
int[] referredToSegments = segmentHeader.getReferredToSegments();
int noOfReferredToSegments = segmentHeader.getReferredToSegmentCount();
switch (segmentType) {
case Segment.SYMBOL_DICTIONARY:
if (JBIG2StreamDecoder.debug)
System.out.println("==== Segment Symbol Dictionary ====");