001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }