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 classInner class that holds information about a JBIG2 page.private static classInner class that holds information about a JBIG2 segment. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate final SortedSetprivate intprivate booleanprivate static final intprivate final SortedMapprivate final RandomAccessFileOrArrayprivate booleanprivate final SortedMapprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[]copyByteArray(byte[] b) (package private) byte[]getGlobal(boolean for_embedding) (package private) JBIG2SegmentReader.JBIG2PagegetPage(int page) private intvoidread()private voidprivate JBIG2SegmentReader.JBIG2Segmentprivate voidtoString()
-
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
-