1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.servlet;
16  
17  import java.io.PrintWriter;
18  import java.io.Writer;
19  
20  import javax.servlet.jsp.JspWriter;
21  
22  /**
23   * <a href="PipingJspWriter.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Shuyang Zhou
26   */
27  public class PipingJspWriter extends JspWriter {
28  
29      public PipingJspWriter(PrintWriter printWriter) {
30          super(NO_BUFFER, false);
31  
32          _printWriter = printWriter;
33      }
34  
35      public PipingJspWriter(Writer writer) {
36          super(NO_BUFFER, false);
37  
38          _printWriter = new PrintWriter(writer, true);
39      }
40  
41      public void clear() {
42          throw new UnsupportedOperationException();
43      }
44  
45      public void clearBuffer() {
46      }
47  
48      public void close() {
49          _printWriter.close();
50      }
51  
52      public void flush() {
53          _printWriter.flush();
54      }
55  
56      public int getRemaining() {
57          return 0;
58      }
59  
60      public void newLine() {
61          _printWriter.println();
62      }
63  
64      public void print(boolean b) {
65          _printWriter.print(b);
66      }
67  
68      public void print(char c) {
69          _printWriter.print(c);
70      }
71  
72      public void print(char[] charArray) {
73          _printWriter.print(charArray);
74      }
75  
76      public void print(double d) {
77          _printWriter.print(d);
78      }
79  
80      public void print(float f) {
81          _printWriter.print(f);
82      }
83  
84      public void print(int i) {
85          _printWriter.print(i);
86      }
87  
88      public void print(long l) {
89          _printWriter.print(l);
90      }
91  
92      public void print(Object object) {
93          _printWriter.print(object);
94      }
95  
96      public void print(String string) {
97          _printWriter.print(string);
98      }
99  
100     public void println() {
101         _printWriter.println();
102     }
103 
104     public void println(boolean b) {
105         _printWriter.println(b);
106     }
107 
108     public void println(char c) {
109         _printWriter.println(c);
110     }
111 
112     public void println(char[] charArray) {
113         _printWriter.println(charArray);
114     }
115 
116     public void println(double d) {
117         _printWriter.println(d);
118     }
119 
120     public void println(float f) {
121         _printWriter.println(f);
122     }
123 
124     public void println(int i) {
125         _printWriter.println(i);
126     }
127 
128     public void println(long l) {
129         _printWriter.println(l);
130     }
131 
132     public void println(Object object) {
133         _printWriter.println(object);
134     }
135 
136     public void println(String string) {
137         _printWriter.println(string);
138     }
139 
140     public void write(char[] charArray, int offset, int length) {
141         _printWriter.write(charArray, offset, length);
142     }
143 
144     private PrintWriter _printWriter;
145 
146 }