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    
019    import javax.servlet.ServletInputStream;
020    
021    /**
022     * @author Brian Wing Shun Chan
023     */
024    public class UnsyncByteArrayInputStreamWrapper extends ServletInputStream {
025    
026            public UnsyncByteArrayInputStreamWrapper(
027                    UnsyncByteArrayInputStream unsyncByteArrayInputStream) {
028    
029                    _unsyncByteArrayInputStream = unsyncByteArrayInputStream;
030            }
031    
032            @Override
033            public int available() {
034                    return _unsyncByteArrayInputStream.available();
035            }
036    
037            @Override
038            public void close() throws IOException {
039                    _unsyncByteArrayInputStream.close();
040            }
041    
042            @Override
043            public void mark(int readLimit) {
044                    _unsyncByteArrayInputStream.mark(readLimit);
045            }
046    
047            @Override
048            public boolean markSupported() {
049                    return _unsyncByteArrayInputStream.markSupported();
050            }
051    
052            @Override
053            public int read() {
054                    return _unsyncByteArrayInputStream.read();
055            }
056    
057            @Override
058            public int read(byte[] bytes) {
059                    return _unsyncByteArrayInputStream.read(bytes);
060            }
061    
062            @Override
063            public int read(byte[] bytes, int offset, int length) {
064                    return _unsyncByteArrayInputStream.read(bytes, offset, length);
065            }
066    
067            @Override
068            public int readLine(byte[] bytes, int offset, int length) {
069                    return _unsyncByteArrayInputStream.read(bytes, offset, length);
070            }
071    
072            @Override
073            public void reset() {
074                    _unsyncByteArrayInputStream.reset();
075            }
076    
077            @Override
078            public long skip(long skip) {
079                    return _unsyncByteArrayInputStream.skip(skip);
080            }
081    
082            private UnsyncByteArrayInputStream _unsyncByteArrayInputStream;
083    
084    }