KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > orb > http > httpserver > ServeOutputStream


1 /*
2  * JacORB - a free Java ORB
3  *
4  * Copyright (C) 1999-2004 Gerald Brose
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */

21 package org.jacorb.orb.http.httpserver;
22
23 import java.io.*;
24
25 public class ServeOutputStream extends OutputStream
26     {
27
28     private PrintStream out;
29     private ServeConnection conn;
30
31     public ServeOutputStream( OutputStream out, ServeConnection conn )
32     {
33     this.out = new PrintStream( out );
34     this.conn = conn;
35     }
36
37     public void write( int b ) throws IOException
38     {
39     conn.writeHeaders();
40     out.write( b );
41     }
42
43     public void write( byte[] b, int off, int len ) throws IOException
44     {
45     conn.writeHeaders();
46     out.write( b, off, len );
47     }
48
49     public void flush() throws IOException
50     {
51     conn.writeHeaders();
52     out.flush();
53     }
54
55     public void close() throws IOException
56     {
57     conn.writeHeaders();
58     out.close();
59
60     }
61
62     public void print( String JavaDoc s ) throws IOException
63     {
64     conn.writeHeaders();
65     out.print( s );
66     }
67
68     public void print( int i ) throws IOException
69     {
70     conn.writeHeaders();
71     out.print( i );
72     }
73
74     public void print( long l ) throws IOException
75     {
76     conn.writeHeaders();
77     out.print( l );
78     }
79
80     public void println( String JavaDoc s ) throws IOException
81     {
82     conn.writeHeaders();
83     out.println( s );
84     }
85
86     public void println( int i ) throws IOException
87     {
88     conn.writeHeaders();
89     out.println( i );
90     }
91
92     public void println( long l ) throws IOException
93     {
94     conn.writeHeaders();
95     out.println( l );
96     }
97
98     public void println() throws IOException
99     {
100     conn.writeHeaders();
101     out.println();
102     }
103
104     }
105
106
107
108
109
110
111
Popular Tags