01: /*
02: * Copyright 2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
19: import java.io.IOException;
20: import java.io.Writer;
21:
22: /**
23: * This Writer writes always to the current pageContext.getOut() Writer.
24: *
25: * @author Manfred Geiler (latest modification by $Author: oros $)
26: * @version $Revision: 265611 $ $Date: 2005-09-01 03:05:16 +0200 (Do, 01 Sep 2005) $
27: */
28: class _PageContextOutWriter extends Writer {
29: private PageContext _pageContext;
30:
31: public _PageContextOutWriter(PageContext pageContext) {
32: _pageContext = pageContext;
33: }
34:
35: public void close() throws IOException {
36: _pageContext.getOut().close();
37: }
38:
39: public void flush() throws IOException {
40: _pageContext.getOut().flush();
41: }
42:
43: public void write(char cbuf[], int off, int len) throws IOException {
44: _pageContext.getOut().write(cbuf, off, len);
45: }
46:
47: public void write(int c) throws IOException {
48: _pageContext.getOut().write(c);
49: }
50:
51: public void write(char cbuf[]) throws IOException {
52: _pageContext.getOut().write(cbuf);
53: }
54:
55: public void write(String str) throws IOException {
56: _pageContext.getOut().write(str);
57: }
58:
59: public void write(String str, int off, int len) throws IOException {
60: _pageContext.getOut().write(str, off, len);
61: }
62:
63: }
|