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