Package com.aowagie.text.pdf.codec
Class JBIG2SegmentReader
- java.lang.Object
-
- com.aowagie.text.pdf.codec.JBIG2SegmentReader
-
class JBIG2SegmentReader extends java.lang.ObjectClass 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 Classes Modifier and Type Class Description static classJBIG2SegmentReader.JBIG2PageInner class that holds information about a JBIG2 page.private static classJBIG2SegmentReader.JBIG2SegmentInner class that holds information about a JBIG2 segment.
-
Field Summary
Fields Modifier and Type Field Description private static intEND_OF_FILEprivate static intEND_OF_PAGEprivate java.util.SortedSetglobalsprivate intnumber_of_pagesprivate booleannumber_of_pages_knownprivate static intPAGE_INFORMATIONprivate java.util.SortedMappagesprivate RandomAccessFileOrArrayraprivate booleanreadprivate java.util.SortedMapsegmentsprivate booleansequential
-
Constructor Summary
Constructors Constructor Description JBIG2SegmentReader(RandomAccessFileOrArray ra)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static byte[]copyByteArray(byte[] b)(package private) byte[]getGlobal(boolean for_embedding)(package private) JBIG2SegmentReader.JBIG2PagegetPage(int page)private intnumberOfPages()voidread()private voidreadFileHeader()private JBIG2SegmentReader.JBIG2SegmentreadHeader()private voidreadSegment(JBIG2SegmentReader.JBIG2Segment s)java.lang.StringtoString()
-
-
-
Field Detail
-
PAGE_INFORMATION
private static final int PAGE_INFORMATION
- See Also:
- Constant Field Values
-
END_OF_PAGE
private static final int END_OF_PAGE
- See Also:
- Constant Field Values
-
END_OF_FILE
private static final int END_OF_FILE
- See Also:
- Constant Field Values
-
segments
private final java.util.SortedMap segments
-
pages
private final java.util.SortedMap pages
-
globals
private final java.util.SortedSet globals
-
ra
private final RandomAccessFileOrArray 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 Detail
-
JBIG2SegmentReader
public JBIG2SegmentReader(RandomAccessFileOrArray ra) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
copyByteArray
private static byte[] copyByteArray(byte[] b)
-
read
public void read() throws java.io.IOException- Throws:
java.io.IOException
-
readSegment
private void readSegment(JBIG2SegmentReader.JBIG2Segment s) throws java.io.IOException
- Throws:
java.io.IOException
-
readHeader
private JBIG2SegmentReader.JBIG2Segment readHeader() throws java.io.IOException
- Throws:
java.io.IOException
-
readFileHeader
private void readFileHeader() throws java.io.IOException- Throws:
java.io.IOException
-
numberOfPages
private int numberOfPages()
-
getPage
JBIG2SegmentReader.JBIG2Page getPage(int page)
-
getGlobal
byte[] getGlobal(boolean for_embedding)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-