View Javadoc

1   /*
2    * $Id: DelegatingInputStream.java 10787 2008-02-12 18:51:50Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.model.streaming;
12  
13  import java.io.IOException;
14  import java.io.InputStream;
15  
16  public class DelegatingInputStream extends InputStream
17  {
18  
19      private InputStream delegate;
20      
21      public DelegatingInputStream(InputStream delegate)
22      {
23          this.delegate = delegate;
24      }
25  
26      public int available() throws IOException
27      {
28          return delegate.available();
29      }
30  
31      public synchronized void mark(int readlimit)
32      {
33          delegate.mark(readlimit);
34      }
35  
36      public boolean markSupported()
37      {
38          return delegate.markSupported();
39      }
40  
41      public synchronized void reset() throws IOException
42      {
43          delegate.reset();
44      }
45  
46      public long skip(long n) throws IOException
47      {
48          return delegate.skip(n);
49      }
50  
51      public int read() throws IOException
52      {
53          return delegate.read();
54      }
55  
56      public int read(byte b[]) throws IOException
57      {
58          return delegate.read(b);
59      }
60  
61      public int read(byte b[], int off, int len) throws IOException
62      {
63          return delegate.read(b, off, len);
64      }
65  
66      public void close() throws IOException
67      {
68          delegate.close();
69      }
70  
71  }