Provide a configurable utility class to create image output streams wrapping 
OutputStream
-----------------------------------------------------------------------------------------

                 Key: GEOT-3559
                 URL: http://jira.codehaus.org/browse/GEOT-3559
             Project: GeoTools
          Issue Type: Bug
    Affects Versions: 2.7.0
            Reporter: Andrea Aime
            Assignee: Andrea Aime
             Fix For: 2.7.1


The current code writing out images via ImageIO on top of output streams builds 
a wrapper around the output streams that allows for random access, either a 
MemoryCacheOutputStream or a FileCacheOutputStream.

The first caches the data in memory before writing, it's fast but does not 
scale up. Suitable for small images.
The second caches the data on the file system, it's slow but scales up to the 
available disk space. Suitable for large images.

Unfortunately ImageIO only allows to decide up front whether to use file or 
disk cache, whilst the decision should be taken on a case by case depending on 
the size of the image to be encoded.
It would be possible to add a new ImageOutputStream SPI generating a wrapper 
that is "smart" and first goes memory and then disk, however that would mean 
rewriting in one the MemoryCacheOutputStream and FileCacheOutputStream code 
(1000loc worth of code) and would not work in modern Tomcat out of the box, all 
reader spi are scrubbed on startup unfortunately (to prevent permgen leaks on 
webapp undeploy).

What we want to do is to create a ImageIOExt class that can take both the image 
and the destination and decide whether to emit a memory or a file cache output 
stream based on a configurable threshold instead.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to