1 16 package org.mortbay.jetty.servlet; 17 18 import java.io.IOException ; 19 import java.io.OutputStream ; 20 21 import javax.servlet.ServletOutputStream ; 22 23 import org.mortbay.util.IO; 24 25 26 class ServletOut extends ServletOutputStream 27 { 28 OutputStream _out; 29 30 31 ServletOut(OutputStream out) 32 { 33 _out=out; 34 } 35 36 37 public void write(int ch) 38 throws IOException 39 { 40 _out.write(ch); 41 } 42 43 44 public void write(byte[]b) 45 throws IOException 46 { 47 _out.write(b); 48 } 49 50 51 public void write(byte[]b,int o,int l) 52 throws IOException 53 { 54 _out.write(b,o,l); 55 } 56 57 58 public void flush() 59 throws IOException 60 { 61 _out.flush(); 62 } 63 64 65 public void close() 66 throws IOException 67 { 68 super.close(); 69 _out.close(); 70 } 71 72 73 public void disable() 74 throws IOException 75 { 76 _out=IO.getNullStream(); 77 } 78 79 80 public void print(String s) throws IOException 81 { 82 if (s!=null) write(s.getBytes()); 83 } 84 85 86 public void println(String s) throws IOException 87 { 88 if (s!=null) write(s.getBytes()); 89 write(IO.CRLF_BYTES); 90 } 91 } 92 | Popular Tags |