KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > webapp > _PageContextOutWriter


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package javax.faces.webapp;
17
18 import javax.servlet.jsp.PageContext JavaDoc;
19 import java.io.IOException JavaDoc;
20 import java.io.Writer JavaDoc;
21
22 /**
23  * This Writer writes always to the current pageContext.getOut() Writer.
24  *
25  * @author Manfred Geiler (latest modification by $Author: mwessendorf $)
26  * @version $Revision: 1.2 $ $Date: 2004/07/01 22:00:54 $
27  */

28 public class _PageContextOutWriter
29         extends Writer JavaDoc
30 {
31     private PageContext JavaDoc _pageContext;
32
33     public _PageContextOutWriter(PageContext JavaDoc pageContext)
34     {
35         _pageContext = pageContext;
36     }
37
38     public void close() throws IOException JavaDoc
39     {
40         _pageContext.getOut().close();
41     }
42
43     public void flush() throws IOException JavaDoc
44     {
45         _pageContext.getOut().flush();
46     }
47
48     public void write(char cbuf[], int off, int len) throws IOException JavaDoc
49     {
50         _pageContext.getOut().write(cbuf, off, len);
51     }
52
53     public void write(int c) throws IOException JavaDoc
54     {
55         _pageContext.getOut().write(c);
56     }
57
58     public void write(char cbuf[]) throws IOException JavaDoc
59     {
60         _pageContext.getOut().write(cbuf);
61     }
62
63     public void write(String JavaDoc str) throws IOException JavaDoc
64     {
65         _pageContext.getOut().write(str);
66     }
67
68     public void write(String JavaDoc str, int off, int len) throws IOException JavaDoc
69     {
70         _pageContext.getOut().write(str, off, len);
71     }
72
73 }
74
Popular Tags