001    /**
002     * Copyright (c) 2000-2013 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            @Override
031            public int available() throws IOException {
032                    return _is.available();
033            }
034    
035            @Override
036            public void close() throws IOException {
037                    _is.close();
038            }
039    
040            @Override
041            public void mark(int readlimit) {
042                    _is.mark(readlimit);
043            }
044    
045            @Override
046            public boolean markSupported() {
047                    return _is.markSupported();
048            }
049    
050            @Override
051            public int read() throws IOException {
052                    return _is.read();
053            }
054    
055            @Override
056            public int read(byte[] b) throws IOException {
057                    return _is.read(b);
058            }
059    
060            @Override
061            public int read(byte[] b, int off, int len) throws IOException {
062                    return _is.read(b, off, len);
063            }
064    
065            @Override
066            public int readLine(byte[] b, int off, int len) throws IOException {
067                    return _is.readLine(b, off, len);
068            }
069    
070            @Override
071            public void reset() throws IOException {
072                    _is.reset();
073            }
074    
075            @Override
076            public long skip(long n) throws IOException {
077                    return _is.skip(n);
078            }
079    
080            private ServletInputStream _is;
081    
082    }