FileDocCategorySizeDatePackage
PNGImageReaderSpi.javaAPI DocAndroid 1.5 API3259Wed May 06 22:41:54 BST 2009org.apache.harmony.x.imageio.plugins.png

PNGImageReaderSpi

public class PNGImageReaderSpi extends ImageReaderSpi

Fields Summary
static final String[]
PNG_NAMES
static final String[]
PNG_SUFFIXES
static final String[]
PNG_MIME_TYPES
static final String
PNG_READER_CLASS_NAME
static final String[]
PNG_READER_SPI_NAMES
Constructors Summary
public PNGImageReaderSpi()


      
        super(
                JPEGSpiConsts.vendorName, JPEGSpiConsts.version,
                PNG_NAMES, PNG_SUFFIXES,
                PNG_MIME_TYPES, PNG_READER_CLASS_NAME,
                STANDARD_INPUT_TYPE, null,
                false, null,
                null, null,
                null, false, 
                null, null,
                null, null
        );
    
Methods Summary
public booleancanDecodeInput(java.lang.Object source)

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

        byte[] signature = new byte[8];
        markable.seek(0);

        int nBytes = markable.read(signature, 0, 8);
        if(nBytes != 8) markable.read(signature, nBytes, 8-nBytes);
        markable.reset();

        // PNG signature: 137 80 78 71 13 10 26 10
        return  (signature[0] & 0xFF) == 137 &&
                (signature[1] & 0xFF) == 80 &&
                (signature[2] & 0xFF) == 78 &&
                (signature[3] & 0xFF) == 71 &&
                (signature[4] & 0xFF) == 13 &&
                (signature[5] & 0xFF) == 10 &&
                (signature[6] & 0xFF) == 26 &&
                (signature[7] & 0xFF) == 10;
    
public javax.imageio.ImageReadercreateReaderInstance(java.lang.Object extension)

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

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

        super.onRegistration(registry, category);