1 22 23 package org.meshcms.core; 24 25 import java.io.*; 26 import javax.servlet.*; 27 import javax.servlet.http.*; 28 29 34 public class CacheResponseStream extends ServletOutputStream { 35 ServletOutputStream output; 36 OutputStream cacheOutput; 37 38 47 public CacheResponseStream(HttpServletResponse response, 48 OutputStream cacheOutput) throws IOException { 49 super(); 50 this.cacheOutput = cacheOutput; 51 output = response.getOutputStream(); 52 } 53 54 60 public void write(int b) throws IOException { 61 output.write(b); 62 63 try { 64 cacheOutput.write(b); 65 } catch (IOException ex) {} 66 } 67 68 73 public void flush() throws IOException { 74 output.flush(); 75 76 try { 77 cacheOutput.flush(); 78 } catch (IOException ex) {} 79 } 80 81 86 public void close() throws IOException { 87 output.close(); 88 89 try { 90 cacheOutput.close(); 91 } catch (IOException ex) {} 92 } 93 } 94 | Popular Tags |