org.jpedal.jbig2
Class JBIG2Decoder

java.lang.Object
  extended by org.jpedal.jbig2.JBIG2Decoder

public class JBIG2Decoder
extends java.lang.Object


Constructor Summary
JBIG2Decoder()
          Constructor
 
Method Summary
 void cleanupPostDecode()
           
 void decodeJBIG2(byte[] data)
          Decodes a JBIG2 image from a byte array
 void decodeJBIG2(java.io.DataInput dataInput)
          Decodes a JBIG2 image from a DataInput
 void decodeJBIG2(java.io.File file)
          Decodes a JBIG2 image from a File object
 void decodeJBIG2(java.io.InputStream inputStream)
          Decodes a JBIG2 image from an InputStream
 void decodeJBIG2(java.lang.String file)
          Decodes a JBIG2 image from a String path
 PageInformationSegment findPageSegement(int page)
           
 Segment findSegment(int segmentNumber)
           
 java.util.List getAllSegments()
           
 int getNumberOfPages()
           
 java.awt.image.BufferedImage getPageAsBufferedImage(int page)
           
 JBIG2Bitmap getPageAsJBIG2Bitmap(int page)
           
 boolean isNumberOfPagesKnown()
           
 boolean isRandomAccessOrganisationUsed()
           
 void setGlobalData(byte[] data)
          If the data stream is taken from a PDF, there may be some global data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBIG2Decoder

public JBIG2Decoder()
Constructor

Method Detail

setGlobalData

public void setGlobalData(byte[] data)
                   throws java.io.IOException,
                          JBIG2Exception
If the data stream is taken from a PDF, there may be some global data. Pass any global data in here. Call this method before decodeJBIG2(...)

Parameters:
data - global data
Throws:
java.io.IOException
JBIG2Exception

decodeJBIG2

public void decodeJBIG2(java.io.File file)
                 throws java.io.IOException,
                        JBIG2Exception
Decodes a JBIG2 image from a File object

Parameters:
file - File to decode
Throws:
java.io.IOException
JBIG2Exception

decodeJBIG2

public void decodeJBIG2(java.lang.String file)
                 throws java.io.IOException,
                        JBIG2Exception
Decodes a JBIG2 image from a String path

Parameters:
file - Must be the full path to the image
Throws:
java.io.IOException
JBIG2Exception

decodeJBIG2

public void decodeJBIG2(java.io.InputStream inputStream)
                 throws java.io.IOException,
                        JBIG2Exception
Decodes a JBIG2 image from an InputStream

Parameters:
inputStream - InputStream
Throws:
java.io.IOException
JBIG2Exception

decodeJBIG2

public void decodeJBIG2(java.io.DataInput dataInput)
                 throws java.io.IOException,
                        JBIG2Exception
Decodes a JBIG2 image from a DataInput

Parameters:
dataInput - DataInput
Throws:
java.io.IOException
JBIG2Exception

decodeJBIG2

public void decodeJBIG2(byte[] data)
                 throws java.io.IOException,
                        JBIG2Exception
Decodes a JBIG2 image from a byte array

Parameters:
data - the raw data stream
Throws:
java.io.IOException
JBIG2Exception

cleanupPostDecode

public void cleanupPostDecode()

getPageAsBufferedImage

public java.awt.image.BufferedImage getPageAsBufferedImage(int page)
Parameters:
page -
Returns:

isNumberOfPagesKnown

public boolean isNumberOfPagesKnown()

getNumberOfPages

public int getNumberOfPages()

getAllSegments

public java.util.List getAllSegments()

findPageSegement

public PageInformationSegment findPageSegement(int page)

findSegment

public Segment findSegment(int segmentNumber)

getPageAsJBIG2Bitmap

public JBIG2Bitmap getPageAsJBIG2Bitmap(int page)

isRandomAccessOrganisationUsed

public boolean isRandomAccessOrganisationUsed()