Package javax.imageio.spi

Examples of javax.imageio.spi.ImageInputStreamSpi


public class needsCacheFile
  implements Testlet
{
  public void test(TestHarness h)
  {
    ImageInputStreamSpi sp;

    // Check #1: The default implementation must return false.
    sp = new TestProvider();
    h.check(sp.needsCacheFile() == false);
  }
View Full Code Here


public class canUseCacheFile
  implements Testlet
{
  public void test(TestHarness h)
  {
    ImageInputStreamSpi sp;

    // Check #1: The default implementation must return false.
    sp = new TestProvider();
    h.check(sp.canUseCacheFile() == false);
  }
View Full Code Here

        }

        boolean usecache = getUseCache() && hasCachePermission();

        while (iter.hasNext()) {
            ImageInputStreamSpi spi = (ImageInputStreamSpi)iter.next();
            if (spi.getInputClass().isInstance(input)) {
                try {
                    return spi.createInputStreamInstance(input,
                                                         usecache,
                                                         getCacheDirectory());
                } catch (IOException e) {
                    throw new IIOException("Can't create cache file!", e);
                }
View Full Code Here

        }

        boolean usecache = getUseCache() && hasCachePermission();

        while (iter.hasNext()) {
            ImageInputStreamSpi spi = (ImageInputStreamSpi)iter.next();
            if (spi.getInputClass().isInstance(input)) {
                try {
                    return spi.createInputStreamInstance(input,
                                                         usecache,
                                                         getCacheDirectory());
                } catch (IOException e) {
                    throw new IIOException("Can't create cache file!", e);
                }
View Full Code Here

        }

        boolean usecache = getUseCache() && hasCachePermission();

        while (iter.hasNext()) {
            ImageInputStreamSpi spi = (ImageInputStreamSpi)iter.next();
            if (spi.getInputClass().isInstance(input)) {
                try {
                    return spi.createInputStreamInstance(input,
                                                         usecache,
                                                         getCacheDirectory());
                } catch (IOException e) {
                    throw new IIOException("Can't create cache file!", e);
                }
View Full Code Here

        }

        boolean usecache = getUseCache() && hasCachePermission();

        while (iter.hasNext()) {
            ImageInputStreamSpi spi = (ImageInputStreamSpi)iter.next();
            if (spi.getInputClass().isInstance(input)) {
                try {
                    return spi.createInputStreamInstance(input,
                                                         usecache,
                                                         getCacheDirectory());
                } catch (IOException e) {
                    throw new IIOException("Can't create cache file!", e);
                }
View Full Code Here

            return null;
        }
   
        boolean usecache = ImageIO.getUseCache();
   
        ImageInputStreamSpi spi = null;
        while (iter.hasNext()) {
            spi = (ImageInputStreamSpi) iter.next();
            if (spi.getInputClass().isInstance(input)) {
               
                // Stream creation check
                if (streamCreationCheck){
                    ImageInputStream stream = null;
                    try {
                        stream = spi.createInputStreamInstance(input, usecache, ImageIO.getCacheDirectory());
                        break;
                    } catch (IOException e) {
                        return null;
                    } finally {
                        //Make sure to close the created stream
View Full Code Here

        return readerSPI;
    }

    public static ImageInputStreamSpi getInputStreamSPIFromURL(URL granuleUrl) throws IOException {

        ImageInputStreamSpi streamSPI = ImageIOExt.getImageInputStreamSPI(granuleUrl, true);
        if (streamSPI == null) {
            final File file = DataUtilities.urlToFile(granuleUrl);
            if (file != null) {
                if (LOGGER.isLoggable(Level.WARNING)) {
                    LOGGER.log(Level.WARNING, Utils.getFileInfo(file));
View Full Code Here

            if(configHandler.getCachedReaderSPI() == null){
                // Get the URL associated to the file
                URL granuleUrl = DataUtilities
                        .fileToURL(fileBeingProcessed);
                // Get the ImageInputStreamSPI associated to the URL
                ImageInputStreamSpi inStreamSpi = Utils.getInputStreamSPIFromURL(granuleUrl);
                // Ensure that the ImageInputStreamSPI is available
                if(inStreamSpi==null){
                    throw new IllegalArgumentException("no inputStreamSPI available!");
                }
                ImageInputStream inStream=null;
                try{
                    // Get the ImageInputStream from the SPI
                    inStream = inStreamSpi
                            .createInputStreamInstance(granuleUrl, ImageIO.getUseCache(),
                                    ImageIO.getCacheDirectory());
                    // Throws an Exception if the ImageInputStream is not present
                    if(inStream == null){
                        if(LOGGER.isLoggable(Level.WARNING)){
View Full Code Here

     * Reads an image from a GeoTIFF file. For more information, see
     * <a href="http://download.java.net/media/jai-imageio/javadoc/1.1/com/sun/media/jai/operator/ImageReadDescriptor.html#RenderedMode">ImageReadDescriptor</a>
     */
    private static synchronized RenderedImage readImage(File inFile) throws IOException {
        final ParameterBlock readParams = new ParameterBlock();
        ImageInputStreamSpi lSpi = ImageIOExt.getImageInputStreamSPI(inFile);
        PlanarImage lImage = null;
        ImageInputStream lImgIn =
            lSpi.createInputStreamInstance(inFile, false, null);
        readParams.add(lImgIn);
        readParams.add(0);
        readParams.add(Boolean.FALSE);
        readParams.add(Boolean.FALSE);
        readParams.add(Boolean.FALSE);
View Full Code Here

TOP

Related Classes of javax.imageio.spi.ImageInputStreamSpi

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.