001    /**
002     * Copyright (c) 2000-2011 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            public int available() throws IOException {
034                    return inputStream.available();
035            }
036    
037            public void close() throws IOException {
038                    inputStream.close();
039            }
040    
041            public void mark(int readLimit) {
042                    inputStream.mark(readLimit);
043            }
044    
045            public boolean markSupported() {
046                    return inputStream.markSupported();
047            }
048    
049            public int read() throws IOException {
050                    return inputStream.read();
051            }
052    
053            public int read(byte[] byteArray) throws IOException {
054                    return inputStream.read(byteArray);
055            }
056    
057            public int read(byte[] byteArray, int offset, int length)
058                    throws IOException {
059    
060                    return inputStream.read(byteArray, offset, length);
061            }
062    
063            public void reset() throws IOException {
064                    inputStream.reset();
065            }
066    
067            public long skip(long skip) throws IOException {
068                    return inputStream.skip(skip);
069            }
070    
071            protected InputStream inputStream;
072    
073    }