Package org.jpedal.jbig2
Class JBIG2Decoder
java.lang.Object
org.jpedal.jbig2.JBIG2Decoder
JBIG2Decoder class.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
decodeJBIG2
(byte[] data) Decodes a JBIG2 image from a byte arrayvoid
decodeJBIG2
(File file) Decodes a JBIG2 image from a File objectvoid
decodeJBIG2
(InputStream inputStream) Decodes a JBIG2 image from an InputStreamvoid
decodeJBIG2
(String file) Decodes a JBIG2 image from a String pathfindPageSegement
(int page) findPageSegement.findSegment
(int segmentNumber) findSegment.getAllSegments.int
getNumberOfPages.getPageAsBufferedImage
(int page) getPageAsBufferedImage.getPageAsJBIG2Bitmap
(int page) getPageAsJBIG2Bitmap.boolean
isNumberOfPagesKnown.boolean
isRandomAccessOrganisationUsed.void
setGlobalData
(byte[] data) If the data stream is taken from a PDF, there may be some global data.
-
Constructor Details
-
JBIG2Decoder
public JBIG2Decoder()Constructor
-
-
Method Details
-
setGlobalData
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:
JBIG2Exception
- if any.
-
decodeJBIG2
Decodes a JBIG2 image from a File object- Parameters:
file
- File to decode- Throws:
IOException
- if any.JBIG2Exception
- if any.
-
decodeJBIG2
Decodes a JBIG2 image from a String path- Parameters:
file
- Must be the full path to the image- Throws:
IOException
- if any.JBIG2Exception
- if any.
-
decodeJBIG2
Decodes a JBIG2 image from an InputStream- Parameters:
inputStream
- InputStream- Throws:
IOException
- if any.JBIG2Exception
- if any.
-
decodeJBIG2
Decodes a JBIG2 image from a byte array- Parameters:
data
- the raw data stream- Throws:
IOException
- if any.JBIG2Exception
- if any.
-
getPageAsBufferedImage
getPageAsBufferedImage.
- Parameters:
page
- aInteger
object.- Returns:
- a
BufferedImage
object.
-
isNumberOfPagesKnown
public boolean isNumberOfPagesKnown()isNumberOfPagesKnown.
- Returns:
- a boolean.
-
getNumberOfPages
public int getNumberOfPages()getNumberOfPages.
- Returns:
- a
Integer
object.
-
getAllSegments
getAllSegments.
- Returns:
- a
List
object.
-
findPageSegement
findPageSegement.
- Parameters:
page
- aInteger
object.- Returns:
- a
PageInformationSegment
object.
-
findSegment
findSegment.
-
getPageAsJBIG2Bitmap
getPageAsJBIG2Bitmap.
- Parameters:
page
- aInteger
object.- Returns:
- a
JBIG2Bitmap
object.
-
isRandomAccessOrganisationUsed
public boolean isRandomAccessOrganisationUsed()isRandomAccessOrganisationUsed.
- Returns:
- a boolean.
-