1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.io.unsync;
16  
17  import java.io.IOException;
18  
19  import javax.servlet.ServletInputStream;
20  
21  /**
22   * <a href="UnsyncByteArrayInputStreamWrapper.java.html"><b><i>View Source</i>
23   * </b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class UnsyncByteArrayInputStreamWrapper extends ServletInputStream {
28  
29      public UnsyncByteArrayInputStreamWrapper(
30          UnsyncByteArrayInputStream unsyncByteArrayInputStream) {
31  
32          _unsyncByteArrayInputStream = unsyncByteArrayInputStream;
33      }
34  
35      public int available() {
36          return _unsyncByteArrayInputStream.available();
37      }
38  
39      public void close() throws IOException {
40          _unsyncByteArrayInputStream.close();
41      }
42  
43      public void mark(int readLimit) {
44          _unsyncByteArrayInputStream.mark(readLimit);
45      }
46  
47      public boolean markSupported() {
48          return _unsyncByteArrayInputStream.markSupported();
49      }
50  
51      public int read() {
52          return _unsyncByteArrayInputStream.read();
53      }
54  
55      public int read(byte[] byteArray) {
56          return _unsyncByteArrayInputStream.read(byteArray);
57      }
58  
59      public int read(byte[] byteArray, int offset, int length) {
60          return _unsyncByteArrayInputStream.read(byteArray, offset, length);
61      }
62  
63      public int readLine(byte[] byteArray, int offset, int length) {
64          return _unsyncByteArrayInputStream.read(byteArray, offset, length);
65      }
66  
67      public void reset() {
68          _unsyncByteArrayInputStream.reset();
69      }
70  
71      public long skip(long skip) {
72          return _unsyncByteArrayInputStream.skip(skip);
73      }
74  
75      private UnsyncByteArrayInputStream _unsyncByteArrayInputStream;
76  
77  }