Class JBIG2SegmentReader


  • public class JBIG2SegmentReader
    extends java.lang.Object
    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
    • Constructor Detail

      • JBIG2SegmentReader

        public JBIG2SegmentReader​(RandomAccessFileOrArray ra)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • copyByteArray

        public static byte[] copyByteArray​(byte[] b)
      • read

        public void read()
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • readFileHeader

        void readFileHeader()
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • numberOfPages

        public int numberOfPages()
      • getPageHeight

        public int getPageHeight​(int i)
      • getPageWidth

        public int getPageWidth​(int i)
      • getGlobal

        public byte[] getGlobal​(boolean for_embedding)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object