001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.util.servlet;
016    
017    import java.io.IOException;
018    
019    import javax.servlet.ServletInputStream;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class ServletInputStreamWrapper extends ServletInputStream {
025    
026            public ServletInputStreamWrapper(ServletInputStream is) {
027                    _is = is;
028            }
029    
030            public int available() throws IOException {
031                    return _is.available();
032            }
033    
034            public void close() throws IOException {
035                    _is.close();
036            }
037    
038            public void mark(int readlimit) {
039                    _is.mark(readlimit);
040            }
041    
042            public boolean markSupported() {
043                    return _is.markSupported();
044            }
045    
046            public int read() throws IOException {
047                    return _is.read();
048            }
049    
050            public int read(byte[] b) throws IOException {
051                    return _is.read(b);
052            }
053    
054            public int read(byte[] b, int off, int len) throws IOException {
055                    return _is.read(b, off, len);
056            }
057    
058            public int readLine(byte[] b, int off, int len) throws IOException {
059                    return _is.readLine(b, off, len);
060            }
061    
062            public void reset() throws IOException {
063                    _is.reset();
064            }
065    
066            public long skip(long n) throws IOException {
067                    return _is.skip(n);
068            }
069    
070            private ServletInputStream _is;
071    
072    }