Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: javax/faces/webapp/_PageContextOutWriter.java


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;
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-08-31 21:05:16 -0400 (Wed, 31 Aug 2005) $
27   */
28  class _PageContextOutWriter
29          extends Writer
30  {
31      private PageContext _pageContext;
32  
33      public _PageContextOutWriter(PageContext pageContext)
34      {
35          _pageContext = pageContext;
36      }
37  
38      public void close() throws IOException
39      {
40          _pageContext.getOut().close();
41      }
42  
43      public void flush() throws IOException
44      {
45          _pageContext.getOut().flush();
46      }
47  
48      public void write(char cbuf[], int off, int len) throws IOException
49      {
50          _pageContext.getOut().write(cbuf, off, len);
51      }
52  
53      public void write(int c) throws IOException
54      {
55          _pageContext.getOut().write(c);
56      }
57  
58      public void write(char cbuf[]) throws IOException
59      {
60          _pageContext.getOut().write(cbuf);
61      }
62  
63      public void write(String str) throws IOException
64      {
65          _pageContext.getOut().write(str);
66      }
67  
68      public void write(String str, int off, int len) throws IOException
69      {
70          _pageContext.getOut().write(str, off, len);
71      }
72  
73  }