Package org.geowebcache.util

Examples of org.geowebcache.util.AccountingOutputStream


        response.setStatus(HttpServletResponse.SC_OK);
        response.setContentType(this.outputFormat.getMimeType());
        response.setCharacterEncoding("UTF-8");

        ServletOutputStream os = response.getOutputStream();
        AccountingOutputStream aos = new AccountingOutputStream(os);

        try {
            ImageIO.write(canvas, outputFormat.getInternalName(), aos);
            aos.close();
        } catch (IOException ioe) {
            log.debug("IOException writing untiled response to client: " + ioe.getMessage());
        }

        log.debug("WMS response size: " + aos.getCount() + "bytes.");

        stats.log(aos.getCount(), CacheResult.WMS);
    }
View Full Code Here


        determineCanvasLayout();
        createCanvas();
        renderCanvas();
        scaleRaster();      
       
        AccountingOutputStream aos=null;
        RenderedImage finalImage =null;
        try{
          finalImage = canvas;

          response.setStatus(HttpServletResponse.SC_OK);
          response.setContentType(this.outputFormat.getMimeType());
          response.setCharacterEncoding("UTF-8");

          ServletOutputStream os = response.getOutputStream();
          aos = new AccountingOutputStream(os);        
         
          // Image encoding with the associated writer
          encoderMap.encode(finalImage, outputFormat, aos,
                    encoderMap.isAggressiveOutputStreamSupported(outputFormat.getMimeType()), null);
         
          log.debug("WMS response size: " + aos.getCount() + "bytes.");
          stats.log(aos.getCount(), CacheResult.WMS);
        } catch (Exception e) {
          log.debug("IOException writing untiled response to client: " + e.getMessage(),e);
         
          // closing the stream
          if(aos!=null){
View Full Code Here

TOP

Related Classes of org.geowebcache.util.AccountingOutputStream

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.