01: package com.sun.portal.rproxy.connectionhandler;
02:
03: import java.io.DataOutputStream;
04: import java.io.IOException;
05:
06: import javax.servlet.ServletOutputStream;
07:
08: public class GatewayServletOutputStream extends ServletOutputStream {
09: private DataOutputStream out;
10:
11: private GatewayServletResponse resp;
12:
13: GatewayServletOutputStream(DataOutputStream output,
14: GatewayServletResponse res) {
15: out = output;
16: resp = res;
17: }
18:
19: public void print(int i) throws IOException {
20: resp.emitHeaders();
21: out.writeBytes(Integer.toString(i));
22: }
23:
24: public void print(long l) throws IOException {
25: resp.emitHeaders();
26: out.writeBytes(Long.toString(l));
27: }
28:
29: public void print(String s) throws IOException {
30: resp.emitHeaders();
31: out.writeBytes(s);
32: }
33:
34: public void println() throws IOException {
35: resp.emitHeaders();
36: out.writeBytes("\r\n");
37: }
38:
39: public void println(int i) throws IOException {
40: resp.emitHeaders();
41: print(i);
42: println();
43: }
44:
45: public void println(long l) throws IOException {
46: resp.emitHeaders();
47: print(l);
48: println();
49: }
50:
51: public void println(String s) throws IOException {
52: resp.emitHeaders();
53: print(s);
54: println();
55: }
56:
57: public void write(int b) throws IOException {
58: resp.emitHeaders();
59: out.write(b);
60: }
61:
62: public void write(byte b[]) throws IOException {
63: resp.emitHeaders();
64: out.write(b);
65: }
66:
67: public void write(byte b[], int off, int len) throws IOException {
68: resp.emitHeaders();
69: out.write(b, off, len);
70: }
71:
72: public void flush() throws IOException {
73: resp.emitHeaders();
74: out.flush();
75: }
76:
77: public void close() throws IOException {
78: out.close();
79: }
80: }
|