001    /**
002     * Copyright (c) 2000-2011 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.portal.kernel.io.unsync;
016    
017    import java.io.IOException;
018    import java.io.InputStream;
019    
020    /**
021     * <p>
022     * See http://issues.liferay.com/browse/LPS-6648.
023     * </p>
024     *
025     * @author Shuyang Zhou
026     */
027    public class UnsyncFilterInputStream extends InputStream {
028    
029            public UnsyncFilterInputStream(InputStream inputStream) {
030                    this.inputStream = inputStream;
031            }
032    
033            @Override
034            public int available() throws IOException {
035                    return inputStream.available();
036            }
037    
038            @Override
039            public void close() throws IOException {
040                    inputStream.close();
041            }
042    
043            @Override
044            public void mark(int readLimit) {
045                    inputStream.mark(readLimit);
046            }
047    
048            @Override
049            public boolean markSupported() {
050                    return inputStream.markSupported();
051            }
052    
053            @Override
054            public int read() throws IOException {
055                    return inputStream.read();
056            }
057    
058            @Override
059            public int read(byte[] bytes) throws IOException {
060                    return inputStream.read(bytes);
061            }
062    
063            @Override
064            public int read(byte[] bytes, int offset, int length)
065                    throws IOException {
066    
067                    return inputStream.read(bytes, offset, length);
068            }
069    
070            @Override
071            public void reset() throws IOException {
072                    inputStream.reset();
073            }
074    
075            @Override
076            public long skip(long skip) throws IOException {
077                    return inputStream.skip(skip);
078            }
079    
080            protected InputStream inputStream;
081    
082    }