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.util.servlet;
16  
17  import java.io.IOException;
18  
19  import javax.servlet.ServletInputStream;
20  
21  /**
22   * <a href="ServletInputStreamWrapper.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   */
26  public class ServletInputStreamWrapper extends ServletInputStream {
27  
28      public ServletInputStreamWrapper(ServletInputStream is) {
29          _is = is;
30      }
31  
32      public int available() throws IOException {
33          return _is.available();
34      }
35  
36      public void close() throws IOException {
37          _is.close();
38      }
39  
40      public void mark(int readlimit) {
41          _is.mark(readlimit);
42      }
43  
44      public boolean markSupported() {
45          return _is.markSupported();
46      }
47  
48      public int read() throws IOException {
49          return _is.read();
50      }
51  
52      public int read(byte[] b) throws IOException {
53          return _is.read(b);
54      }
55  
56      public int read(byte[] b, int off, int len) throws IOException {
57          return _is.read(b, off, len);
58      }
59  
60      public int readLine(byte[] b, int off, int len) throws IOException {
61          return _is.readLine(b, off, len);
62      }
63  
64      public void reset() throws IOException {
65          _is.reset();
66      }
67  
68      public long skip(long n) throws IOException {
69          return _is.skip(n);
70      }
71  
72      private ServletInputStream _is;
73  
74  }