001    /**
002     * Copyright (c) 2000-2010 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    
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    }