1 2 3 27 28 29 package org.apache.coyote.tomcat5; 30 31 import java.io.IOException ; 32 33 import javax.servlet.ServletOutputStream ; 34 35 import org.apache.coyote.Response; 36 37 43 public class CoyoteOutputStream 44 extends ServletOutputStream { 45 46 47 49 50 protected OutputBuffer ob; 51 52 53 55 56 60 public CoyoteOutputStream(OutputBuffer ob) { 61 this.ob = ob; 63 } 64 65 66 68 69 72 protected Object clone() 73 throws CloneNotSupportedException { 74 throw new CloneNotSupportedException (); 75 } 76 77 78 80 81 84 void clear() { 85 ob = null; 86 } 87 88 89 91 92 public void write(int i) 93 throws IOException { 94 ob.writeByte(i); 95 } 96 97 98 public void write(byte[] b) 99 throws IOException { 100 write(b, 0, b.length); 101 } 102 103 104 public void write(byte[] b, int off, int len) 105 throws IOException { 106 ob.write(b, off, len); 107 } 108 109 110 113 public void flush() 114 throws IOException { 115 ob.flush(); 116 } 117 118 119 public void close() 120 throws IOException { 121 ob.close(); 122 } 123 124 125 127 128 public void print(String s) 129 throws IOException { 130 ob.write(s); 131 } 132 133 134 } 135 136 | Popular Tags |