Package com.aowagie.text.pdf.codec
Class JBIG2SegmentReader
java.lang.Object
com.aowagie.text.pdf.codec.JBIG2SegmentReader
Class to read a JBIG2 file at a basic level: understand all the segments,
understand what segments belong to which pages, how many pages there are,
what the width and height of each page is, and global segments if there
are any. Or: the minimum required to be able to take a normal sequential
or random-access organized file, and be able to embed JBIG2 pages as images
in a PDF.
TODO: the indeterminate-segment-size value of dataLength, else?
- Since:
- 2.1.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Inner class that holds information about a JBIG2 page.private static class
Inner class that holds information about a JBIG2 segment. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private final SortedSet
private int
private boolean
private static final int
private final SortedMap
private final RandomAccessFileOrArray
private boolean
private final SortedMap
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]
copyByteArray
(byte[] b) (package private) byte[]
getGlobal
(boolean for_embedding) (package private) JBIG2SegmentReader.JBIG2Page
getPage
(int page) private int
void
read()
private void
private JBIG2SegmentReader.JBIG2Segment
private void
toString()
-
Field Details
-
PAGE_INFORMATION
private static final int PAGE_INFORMATION- See Also:
-
END_OF_PAGE
private static final int END_OF_PAGE- See Also:
-
END_OF_FILE
private static final int END_OF_FILE- See Also:
-
segments
-
pages
-
globals
-
ra
-
sequential
private boolean sequential -
number_of_pages_known
private boolean number_of_pages_known -
number_of_pages
private int number_of_pages -
read
private boolean read
-
-
Constructor Details
-
JBIG2SegmentReader
- Throws:
IOException
-
-
Method Details
-
copyByteArray
private static byte[] copyByteArray(byte[] b) -
read
- Throws:
IOException
-
readSegment
- Throws:
IOException
-
readHeader
- Throws:
IOException
-
readFileHeader
- Throws:
IOException
-
numberOfPages
private int numberOfPages() -
getPage
-
getGlobal
byte[] getGlobal(boolean for_embedding) -
toString
-