Top Description Fields Constructors Methods
org.apache.pdfbox.jbig2

public Class JBIG2ImageReaderSpi

extends ImageReaderSpi
Class Inheritance
Imports
java.io.IOException, java.util.Locale, javax.imageio.ImageReader, javax.imageio.spi.ImageReaderSpi, javax.imageio.stream.ImageInputStream

Necessary extension for ImageIO standard.
See Also
ImageReaderSpi

Field Summary

Modifier and TypeField and Description
pack-priv static final String[]
pack-priv static final String[]
pack-priv static final String[]
pack-priv static final String[]
private static final int[]
FILEHEADER_PREAMBLE

According to D.4.1:

This preamble contains the unique id string for jbig2 files and can be used to check if this reader plugin can decode the given stream.

private static final Class<?>[]
private static final String[]
private static final String[]
pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
private static final String
private static final String[]
pack-priv static final boolean
pack-priv static final boolean
private static final String
private static final String
private static final String[]
Inherited from javax.imageio.spi.ImageReaderSpi:
inputTypesSTANDARD_INPUT_TYPEwriterSpiNames

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canDecodeInput(Object
the object (typically an ImageInputStream) to be decoded.
source
)

Implements abstract javax.imageio.spi.ImageReaderSpi.canDecodeInput.

Returns true if the supplied source object appears to be of the format supported by this reader.

public ImageReader
createReaderInstance(Object
a plug-in specific extension object, which may be null.
extension
)

Implements abstract javax.imageio.spi.ImageReaderSpi.createReaderInstance.

Returns an instance of the ImageReader implementation associated with this service provider.

public String
getDescription(Locale
a Locale for which the return value should be localized.
locale
)

Implements abstract javax.imageio.spi.IIOServiceProvider.getDescription.

Returns a brief, human-readable description of this service provider and its associated implementation.

Inherited from javax.imageio.spi.ImageReaderSpi:
createReaderInstancegetImageWriterSpiNamesgetInputTypesisOwnReader

Field Detail

EXTRA_IMAGE_METADATA_FORMAT_CLASSNAMEback to summary
pack-priv static final String[] EXTRA_IMAGE_METADATA_FORMAT_CLASSNAME
EXTRA_IMAGE_METADATA_FORMAT_NAMEback to summary
pack-priv static final String[] EXTRA_IMAGE_METADATA_FORMAT_NAME
EXTRA_STREAM_METADATA_FORMAT_CLASSNAMEback to summary
pack-priv static final String[] EXTRA_STREAM_METADATA_FORMAT_CLASSNAME
EXTRA_STREAM_METADATA_FORMAT_NAMEback to summary
pack-priv static final String[] EXTRA_STREAM_METADATA_FORMAT_NAME
FILEHEADER_PREAMBLEback to summary
private static final int[] FILEHEADER_PREAMBLE

According to D.4.1:

This preamble contains the unique id string for jbig2 files and can be used to check if this reader plugin can decode the given stream. This can only work with native jbig2 data. If the stream is embedded in another file format this preamble might be missing.

INPUT_TYPESback to summary
private static final Class<?>[] INPUT_TYPES
MIME_TYPESback to summary
private static final String[] MIME_TYPES
NAMESback to summary
private static final String[] NAMES
NATIVE_IMAGE_METADATA_FORMAT_CLASSNAMEback to summary
pack-priv static final String NATIVE_IMAGE_METADATA_FORMAT_CLASSNAME
NATIVE_IMAGE_METADATA_FORMAT_NAMEback to summary
pack-priv static final String NATIVE_IMAGE_METADATA_FORMAT_NAME
NATIVE_STREAM_METADATA_FORMAT_CLASSNAMEback to summary
pack-priv static final String NATIVE_STREAM_METADATA_FORMAT_CLASSNAME
NATIVE_STREAM_METADATA_FORMAT_NAMEback to summary
pack-priv static final String NATIVE_STREAM_METADATA_FORMAT_NAME
READER_CLASS_NAMEback to summary
private static final String READER_CLASS_NAME
SUFFIXESback to summary
private static final String[] SUFFIXES
SUPPORTS_STANDARD_IMAGE_METADATA_FORMATback to summary
pack-priv static final boolean SUPPORTS_STANDARD_IMAGE_METADATA_FORMAT
SUPPORTS_STANDARD_STREAM_METADATE_FORMATback to summary
pack-priv static final boolean SUPPORTS_STANDARD_STREAM_METADATE_FORMAT
VENDORback to summary
private static final String VENDOR
VERSIONback to summary
private static final String VERSION
WRITER_SPI_NAMESback to summary
private static final String[] WRITER_SPI_NAMES

Constructor Detail

JBIG2ImageReaderSpiback to summary
public JBIG2ImageReaderSpi()

Method Detail

canDecodeInputback to summary
public boolean canDecodeInput(Object source) throws IOException

Implements abstract javax.imageio.spi.ImageReaderSpi.canDecodeInput.

Doc from javax.imageio.spi.ImageReaderSpi.canDecodeInput.

Returns true if the supplied source object appears to be of the format supported by this reader. Returning true from this method does not guarantee that reading will succeed, only that there appears to be a reasonable chance of success based on a brief inspection of the stream contents. If the source is an ImageInputStream, implementations will commonly check the first several bytes of the stream for a "magic number" associated with the format. Once actual reading has commenced, the reader may still indicate failure at any time prior to the completion of decoding.

It is important that the state of the object not be disturbed in order that other ImageReaderSpis can properly determine whether they are able to decode the object. In particular, if the source is an ImageInputStream, a mark/reset pair should be used to preserve the stream position.

Formats such as "raw," which can potentially attempt to read nearly any stream, should return false in order to avoid being invoked in preference to a closer match.

If source is not an instance of one of the classes returned by getInputTypes, the method should simply return false.

Parameters
source:Object

the object (typically an ImageInputStream) to be decoded.

Returns:boolean

true if it is likely that this stream can be decoded.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs while reading the stream.
createReaderInstanceback to summary
public ImageReader createReaderInstance(Object extension) throws IOException

Implements abstract javax.imageio.spi.ImageReaderSpi.createReaderInstance.

Doc from javax.imageio.spi.ImageReaderSpi.createReaderInstance.

Returns an instance of the ImageReader implementation associated with this service provider. The returned object will initially be in an initial state as if its reset method had been called.

An Object may be supplied to the plug-in at construction time. The nature of the object is entirely plug-in specific.

Typically, a plug-in will implement this method using code such as return new MyImageReader(this).

Parameters
extension:Object

a plug-in specific extension object, which may be null.

Returns:ImageReader

an ImageReader instance.

Annotations
@Override
Exceptions
IOException:
if the attempt to instantiate the reader fails.
getDescriptionback to summary
public String getDescription(Locale locale)

Implements abstract javax.imageio.spi.IIOServiceProvider.getDescription.

Doc from javax.imageio.spi.IIOServiceProvider.getDescription.

Returns a brief, human-readable description of this service provider and its associated implementation. The resulting string should be localized for the supplied Locale, if possible.

Parameters
locale:Locale

a Locale for which the return value should be localized.

Returns:String

a String containing a description of this service provider.

Annotations
@Override