Package it.geosolutions.imageio.stream.input

Examples of it.geosolutions.imageio.stream.input.FileImageInputStreamExt


        final String worldFileExtension,
            final ImageReaderSpi formatSpecificSpi) throws DataSourceException {
        super(input, hints);
       
      ImageReader reader=null;
      FileImageInputStreamExt fiis = null;
        try {
           

            readerSPI = formatSpecificSpi;
            worldFileExt = worldFileExtension;

            // //
            //
            // Source management
            //
            // //
            checkSource(input);
           
            // //
            //
            // Setting Envelope, GridRange and CRS
            //
            // //
            reader = readerSPI.createReaderInstance();
            fiis = new FileImageInputStreamExtImpl(inputFile);
            reader.setInput(fiis);
            setLayout(reader);
            setCoverageProperties(reader);

            // //
            //
            // Information about multiple levels and such
            //
            // //
            getResolutionInfo(reader);

        } catch (IOException e) {
            if (LOGGER.isLoggable(Level.SEVERE))
                LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);

            throw new DataSourceException(e);
        } catch (TransformException e) {
            if (LOGGER.isLoggable(Level.SEVERE))
                LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);

            throw new DataSourceException(e);
        }
        finally {

            // //
            //
            // Reset and dispose reader
            //
            // //
          if(reader!=null) {
            try {
              reader.reset();
            }catch (Exception e) {
                    if (LOGGER.isLoggable(Level.FINE))
                        LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
        }
           
            try {
              reader.dispose();
            }catch (Exception e) {
                    if (LOGGER.isLoggable(Level.FINE))
                        LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
        }           
               
          }
         
          if (fiis!=null){
              try {
                        fiis.close();
                    }catch (Exception e) {
                        if (LOGGER.isLoggable(Level.FINE))
                            LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
                    }
                   
View Full Code Here

TOP

Related Classes of it.geosolutions.imageio.stream.input.FileImageInputStreamExt

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.