1   /*
2    * Copyright 2005 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.vafer.jdeb.ar;
17  
18  import java.io.IOException;
19  import java.io.InputStream;
20  
21  /**
22   * ATTENTION: don't use outside of jdeb
23   * 
24   * @author Torsten Curdt <tcurdt@vafer.org>
25   */
26  public final class NonClosingInputStream extends InputStream {
27  
28  	private final InputStream delegate;
29  	
30  	public NonClosingInputStream( final InputStream pDelegate ) {
31  		delegate = pDelegate;
32  	}
33  
34  	public int available() throws IOException {
35  		return delegate.available();
36  	}
37  
38  	public void close() throws IOException {
39  		// we DON'T close
40  		// delegate.close();
41  	}
42  
43  	public void mark(int readlimit) {
44  		delegate.mark(readlimit);
45  	}
46  
47  	public boolean markSupported() {
48  		return delegate.markSupported();
49  	}
50  
51  	public int read() throws IOException {
52  		return delegate.read();
53  	}
54  
55  	public int read(byte[] b, int off, int len) throws IOException {
56  		return delegate.read(b, off, len);
57  	}
58  
59  	public int read(byte[] b) throws IOException {
60  		return delegate.read(b);
61  	}
62  
63  	public void reset() throws IOException {
64  		delegate.reset();
65  	}
66  
67  	public long skip(long n) throws IOException {
68  		return delegate.skip(n);
69  	}
70  	
71  }