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

JPEGImageReader

public class JPEGImageReader extends ImageReader
This implementation uses org.apache.harmony.awt.gl.image.JpegDecoder to read an image. The only implemented method is read(..); TODO: Implements generic decoder to be used by javad2 and imageio
see
org.apache.harmony.awt.gl.image.JpegDecoder
see
org.apache.harmony.x.imageio.plugins.jpeg.IISDecodingImageSource

Fields Summary
ImageInputStream
iis
Constructors Summary
public JPEGImageReader(ImageReaderSpi imageReaderSpi)

        super(imageReaderSpi);
    
Methods Summary
public javax.imageio.ImageReadParamgetDefaultReadParam()

        return new JPEGImageReadParam();
    
public intgetHeight(int i)

        //-- TODO imlement
        throw new UnsupportedOperationException("not implemented yet");
    
public javax.imageio.metadata.IIOMetadatagetImageMetadata(int i)

        //-- TODO imlement
        throw new UnsupportedOperationException("not implemented yet");
    
public java.util.IteratorgetImageTypes(int i)

        //-- TODO imlement
        throw new UnsupportedOperationException("not implemented yet");
    
public intgetNumImages(boolean b)

        //-- TODO imlement
        throw new UnsupportedOperationException("not implemented yet");
    
public javax.imageio.metadata.IIOMetadatagetStreamMetadata()

        //-- TODO imlement
        throw new UnsupportedOperationException("not implemented yet");
    
public intgetWidth(int i)

        //-- TODO imlement
        throw new UnsupportedOperationException("not implemented yet");
    
public java.awt.image.BufferedImageread(int i, javax.imageio.ImageReadParam imageReadParam)

        if (iis == null) {
            throw new IllegalArgumentException("input stream == null");
        }

        DecodingImageSource source = new IISDecodingImageSource(iis);
        OffscreenImage image = new OffscreenImage(source);
        source.addConsumer(image);
        source.load();
        // The interrupted flag should be cleared because ImageDecoder interrupts
        // current thread while decoding. The same technique is used in
        // ImageLoader#run(). Another solution can be to create
        // a separate decoding thread. However, decoder keeps its own pool
        // of threads so creating a new thread will be just a waste of resources.
        Thread.interrupted();
        return image.getBufferedImage();
    
public java.awt.image.BufferedImageread(int i)

        return read(i, null);
    
public voidsetInput(java.lang.Object input, boolean seekForwardOnly, boolean ignoreMetadata)

        super.setInput(input, seekForwardOnly, ignoreMetadata);
        iis = (ImageInputStream) input;