1 29 30 package com.caucho.jsp; 31 32 import javax.servlet.ServletOutputStream ; 33 import java.io.IOException ; 34 import java.io.OutputStream ; 35 36 class JspServletOutputStream extends ServletOutputStream { 37 private PageContextImpl _pageContext; 38 private OutputStream _os; 39 40 JspServletOutputStream(PageContextImpl pageContext) 41 { 42 _pageContext = pageContext; 43 } 44 45 public final void write(int b) throws IOException 46 { 47 getOutputStream().write(b); 48 } 49 50 public final void write(byte []buf, int offset, int len) throws IOException 51 { 52 getOutputStream().write(buf, offset, len); 53 } 54 55 public final void flush() throws IOException 56 { 57 if (_os != null) 58 _os.flush(); 59 } 60 61 public final void close() throws IOException 62 { 63 } 64 65 68 private OutputStream getOutputStream() 69 { 70 if (_os == null) { 71 _os = _pageContext.getOutputStream(); 72 } 73 74 return _os; 75 } 76 77 void release() 78 { 79 _os = null; 80 } 81 } 82 | Popular Tags |