FileDocCategorySizeDatePackage
JPEGImageReaderSpi.javaAPI DocJava SE 5 API2914Fri Aug 26 14:54:42 BST 2005com.sun.imageio.plugins.jpeg

JPEGImageReaderSpi

public class JPEGImageReaderSpi extends ImageReaderSpi

Fields Summary
private static String[]
writerSpiNames
private boolean
registered
Constructors Summary
public JPEGImageReaderSpi()

    
      
        super(JPEG.vendor,
              JPEG.version,
              JPEG.names,
              JPEG.suffixes,
              JPEG.MIMETypes,
              "com.sun.imageio.plugins.jpeg.JPEGImageReader",
              STANDARD_INPUT_TYPE,
              writerSpiNames,
              true,
              JPEG.nativeStreamMetadataFormatName,
              JPEG.nativeStreamMetadataFormatClassName,
              null, null,
              true,
              JPEG.nativeImageMetadataFormatName,
              JPEG.nativeImageMetadataFormatClassName,
              null, null
              );
    
Methods Summary
public booleancanDecodeInput(java.lang.Object source)

        if (!(source instanceof ImageInputStream)) {
            return false;
        }
        ImageInputStream iis = (ImageInputStream) source;
        iis.mark();
        // If the first two bytes are a JPEG SOI marker, it's probably
        // a JPEG file.  If they aren't, it definitely isn't a JPEG file.
        int byte1 = iis.read();
        int byte2 = iis.read();
        iis.reset();
        if ((byte1 == 0xFF) && (byte2 == JPEG.SOI)) {
            return true;
        }
        return false;
    
public javax.imageio.ImageReadercreateReaderInstance(java.lang.Object extension)

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

        return "Standard JPEG Image Reader";
    
public voidonRegistration(javax.imageio.spi.ServiceRegistry registry, java.lang.Class category)

        if (registered) {
            return;
        }
        try {
            java.security.AccessController.doPrivileged(
                new sun.security.action.LoadLibraryAction("jpeg"));
            // Stuff it all into one lib for first pass
            //java.security.AccessController.doPrivileged(
            //new sun.security.action.LoadLibraryAction("imageioIJG"));
        } catch (Throwable e) { // Fail on any Throwable
            // if it can't be loaded, deregister and return
            registry.deregisterServiceProvider(this);
            return;
        }

        registered = true;