FileDocCategorySizeDatePackage
JPEGImageReaderSpi.javaAPI DocAndroid 1.5 API3226Wed May 06 22:41:54 BST 2009org.apache.harmony.x.imageio.plugins.jpeg

JPEGImageReaderSpi

public class JPEGImageReaderSpi extends ImageReaderSpi
author
Rustem V. Rafikov
version
$Revision: 1.3 $

Fields Summary
Constructors Summary
public JPEGImageReaderSpi()

        super(JPEGSpiConsts.vendorName, JPEGSpiConsts.version,
                JPEGSpiConsts.names, JPEGSpiConsts.suffixes,
                JPEGSpiConsts.MIMETypes, JPEGSpiConsts.readerClassName,
                STANDARD_INPUT_TYPE, JPEGSpiConsts.writerSpiNames,
                JPEGSpiConsts.supportsStandardStreamMetadataFormat,
                JPEGSpiConsts.nativeStreamMetadataFormatName,
                JPEGSpiConsts.nativeStreamMetadataFormatClassName,
                JPEGSpiConsts.extraStreamMetadataFormatNames,
                JPEGSpiConsts.extraStreamMetadataFormatClassNames,
                JPEGSpiConsts.supportsStandardImageMetadataFormat,
                JPEGSpiConsts.nativeImageMetadataFormatName,
                JPEGSpiConsts.nativeImageMetadataFormatClassName,
                JPEGSpiConsts.extraImageMetadataFormatNames,
                JPEGSpiConsts.extraImageMetadataFormatClassNames);
    
Methods Summary
public booleancanDecodeInput(java.lang.Object source)

        ImageInputStream markable = (ImageInputStream) source;
        try {
            markable.mark();

            byte[] signature = new byte[3];
            markable.seek(0);
            markable.read(signature, 0, 3);
            markable.reset();

            if ((signature[0] & 0xFF) == 0xFF &&
                    (signature[1] & 0xFF) == JPEGConsts.SOI &&
                    (signature[2] & 0xFF) == 0xFF) { // JPEG
                return true;
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return false;
    
public javax.imageio.ImageReadercreateReaderInstance(java.lang.Object extension)

        return new JPEGImageReader(this);
    
public java.lang.StringgetDescription(java.util.Locale locale)

        return "DRL JPEG decoder";
    
public voidonRegistration(javax.imageio.spi.ServiceRegistry registry, java.lang.Class category)

        // super.onRegistration(registry, category);