@@ -253,8 +253,7 @@ void readSegment(Jbig2Segment s) throws java.io.IOException {
253253 ra .seek (last );
254254 Jbig2Page p = pages .get (s .page );
255255 if (p == null ) {
256- throw new IllegalStateException ("referring.to.widht.height.of.page.we.havent.seen.yet.1" );
257- //TODO, s.page);
256+ throw new com .itextpdf .io .IOException ("referring.to.widht.height.of.page.we.havent.seen.yet.1" ).setMessageParams (s .page );
258257 }
259258
260259 p .pageBitmapWidth = page_bitmap_width ;
@@ -307,8 +306,9 @@ Jbig2Segment readHeader() throws java.io.IOException {
307306 }
308307
309308 } else if (count_of_referred_to_segments == 5 || count_of_referred_to_segments == 6 ) {
310- throw new IllegalStateException ("count.of.referred.to.segments.had.bad.value.in.header.for.segment.1.starting.at.2" );
311- //TODO, segment_number, ptr));
309+ throw new com .itextpdf .io .IOException ("count.of.referred.to.segments.had.bad.value.in.header.for.segment.1.starting.at.2" )
310+ .setMessageParams (segment_number , ptr );
311+
312312 }
313313 s .segmentRetentionFlags = segment_retention_flags ;
314314 s .countOfReferredToSegments = count_of_referred_to_segments ;
@@ -335,8 +335,8 @@ Jbig2Segment readHeader() throws java.io.IOException {
335335 segment_page_association = ra .read ();
336336 }
337337 if (segment_page_association < 0 ) {
338- throw new IllegalStateException ("page.1.invalid.for.segment.2.starting.at.3" );
339- //TODO, String.valueOf (segment_page_association), String.valueOf( segment_number), String.valueOf( ptr)) );
338+ throw new com . itextpdf . io . IOException ("page.1.invalid.for.segment.2.starting.at.3" )
339+ . setMessageParams (segment_page_association , segment_number , ptr );
340340 }
341341 s .page = segment_page_association ;
342342 // so we can change the page association at embedding time.
@@ -375,8 +375,7 @@ void readFileHeader() throws java.io.IOException {
375375
376376 for (int i = 0 ; i < idstring .length ; i ++) {
377377 if (idstring [i ] != refidstring [i ]) {
378- throw new IllegalStateException ("file.header.idstring.not.good.at.byte.1" );
379- //TODO, i);
378+ throw new com .itextpdf .io .IOException ("file.header.idstring.not.good.at.byte.1" ).setMessageParams (i );
380379 }
381380 }
382381
@@ -386,7 +385,7 @@ void readFileHeader() throws java.io.IOException {
386385 this .number_of_pages_known = (fileheaderflags & 0x2 ) == 0x0 ;
387386
388387 if ((fileheaderflags & 0xfc ) != 0x0 ) {
389- throw new IllegalStateException ("file.header.flags.bits.2.7.not.0" );//TODO
388+ throw new com . itextpdf . io . IOException ("file.header.flags.bits.2.7.not.0" );
390389 }
391390
392391 if (this .number_of_pages_known ) {
0 commit comments