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.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) throws IOException {
065                    return inputStream.read(bytes, offset, length);
066            }
067    
068            @Override
069            public void reset() throws IOException {
070                    inputStream.reset();
071            }
072    
073            @Override
074            public long skip(long skip) throws IOException {
075                    return inputStream.skip(skip);
076            }
077    
078            protected InputStream inputStream;
079    
080    }