Source code: com/prolifics/servlet/FilterServletInputStream.java
1 /*************************************************/
2 /* Copyright (c) 1999 */
3 /* by */
4 /* JYACC, Inc., New York NY USA */
5 /* and contributors. */
6 /* Use of this program is governed by the */
7 /* JYACC Public License Version 1.0, a copy of */
8 /* which can be obtained at */
9 /* http://www.possl.org/jyacc-license.html */
10 /*************************************************/
11
12 /* @(#)FilterServletInputStream.java 77.1 99/04/22 15:03:04 */
13
14 package com.prolifics.servlet;
15 import java.io.*;
16 import javax.servlet.*;
17 import javax.servlet.http.*;
18
19 public
20 class FilterServletInputStream extends ServletInputStream
21 {
22 private static String sccsid = "@(#)FilterServletInputStream.java 77.1 99/04/22 15:03:04";
23 protected InputStream in;
24
25 public FilterServletInputStream(InputStream in)
26 {
27 this.in = in;
28 }
29
30 public FilterServletInputStream(ServletInputStream in)
31 {
32 this.in = in;
33 }
34
35 public int read() throws IOException
36 {
37 return in.read();
38 }
39
40 public int read(byte buf[]) throws IOException
41 {
42 return read(buf, 0, buf.length);
43 }
44
45 public int read(byte buf[], int off, int len) throws IOException
46 {
47 return in.read(buf, off, len);
48 }
49
50 public long skip(long count) throws IOException
51 {
52 return in.skip(count);
53 }
54
55 public int available() throws IOException
56 {
57 return in.available();
58 }
59
60 public void close() throws IOException
61 {
62 in.close();
63 }
64
65 public synchronized void mark(int readlimit)
66 {
67 in.mark(readlimit);
68 }
69
70 public synchronized void reset() throws IOException
71 {
72 in.reset();
73 }
74
75 public boolean markSupported()
76 {
77 return in.markSupported();
78 }
79
80 public int readLine(byte[] buf, int off, int len) throws IOException
81 {
82 if (in instanceof ServletInputStream)
83 {
84 ServletInputStream sIn = (ServletInputStream) in;
85 return sIn.readLine(buf, off, len);
86 }
87 else
88 {
89 return super.readLine(buf, off, len);
90 }
91 }
92 }