1 23 24 package org.dbforms.util; 25 26 import java.io.IOException ; 27 28 31 import javax.servlet.ServletResponse ; 32 import javax.servlet.jsp.JspWriter ; 33 34 35 36 42 public class JspWriterBuffer extends JspWriter { 43 private StringBuffer buf = new StringBuffer (); 44 45 52 protected JspWriterBuffer(int bufferSize, 53 boolean autoFlush, 54 ServletResponse response) { 55 super(bufferSize, autoFlush); 56 } 57 58 63 public StringBuffer getBuffer() { 64 return buf; 65 } 66 67 68 73 public int getRemaining() { 74 return 0; 75 } 76 77 78 83 public String getResult() { 84 return buf.toString(); 85 } 86 87 88 93 public void clear() throws IOException { 94 clearBuffer(); 95 } 96 97 98 103 public void clearBuffer() throws IOException { 104 buf = new StringBuffer (); 105 } 106 107 108 113 public void close() throws IOException { 114 } 115 116 117 122 public void flush() throws IOException { 123 } 124 125 126 131 public void newLine() throws IOException { 132 } 133 134 135 142 public void print(boolean b) throws IOException { 143 buf.append(b); 144 } 145 146 147 154 public void print(char c) throws IOException { 155 buf.append(c); 156 } 157 158 159 166 public void print(char[] s) throws IOException { 167 buf.append(s); 168 } 169 170 171 178 public void print(int i) throws IOException { 179 buf.append(i); 180 } 181 182 183 190 public void print(long l) throws IOException { 191 buf.append(l); 192 } 193 194 195 202 public void print(float f) throws IOException { 203 buf.append(f); 204 } 205 206 207 214 public void print(double d) throws IOException { 215 buf.append(d); 216 } 217 218 219 226 public void print(String s) throws IOException { 227 buf.append(s); 228 } 229 230 231 238 public void print(Object obj) throws IOException { 239 buf.append(obj); 240 } 241 242 243 248 public void println() throws IOException { 249 buf.append('\n'); 250 } 251 252 253 260 public void println(boolean x) throws IOException { 261 print(x); 262 println(); 263 } 264 265 266 273 public void println(char x) throws IOException { 274 print(x); 275 println(); 276 } 277 278 279 286 public void println(int x) throws IOException { 287 print(x); 288 println(); 289 } 290 291 292 299 public void println(long x) throws IOException { 300 print(x); 301 println(); 302 } 303 304 305 312 public void println(float x) throws IOException { 313 print(x); 314 println(); 315 } 316 317 318 325 public void println(double x) throws IOException { 326 print(x); 327 println(); 328 } 329 330 331 338 public void println(char[] x) throws IOException { 339 print(x); 340 println(); 341 } 342 343 344 351 public void println(String x) throws IOException { 352 print(x); 353 println(); 354 } 355 356 357 364 public void println(Object x) throws IOException { 365 print(x); 366 println(); 367 } 368 369 370 377 public void write(int c) throws IOException { 378 buf.append(c); 379 } 380 381 382 391 public void write(char[] cbuf, 392 int off, 393 int len) throws IOException { 394 buf.append(cbuf, off, len); 395 } 396 397 398 407 public void write(String str, 408 int off, 409 int len) throws IOException { 410 write(str.toCharArray(), off, len); 411 } 412 } 413 | Popular Tags |