Debian Codegraph @

src/main/java/org/freehep/util/io/NoCloseInputStream.java

raw
1 // Copyright 2001, FreeHEP.
2 package org.freehep.util.io;
3
4 import java.io.BufferedInputStream;
5 import java.io.IOException;
6 import java.io.InputStream;
7
8 /**
9 * The NoCloseInputStream ignores the close so that one can keep reading from
10 * the underlying stream.
11 *
12 * @author Mark Donszelmann
13 * @version $Id: NoCloseInputStream.java 8584 2006-08-10 23:06:37Z duns $
14 */
15 public class NoCloseInputStream extends BufferedInputStream {
16
17 /**
18 * Creates a No Close Input Stream.
19 *
20 * @param stream stream to read from
21 */
22 public NoCloseInputStream(InputStream stream) {
23 super(stream);
24 }
25
26 /**
27 * Creates a No Close Input Stream.
28 *
29 * @param stream stream to read from
30 * @param size buffer size
31 */
32 public NoCloseInputStream(InputStream stream, int size) {
33 super(stream, size);
34 }
35
36 public void close() throws IOException {
37 }
38
39 /**
40 * Close this stream (the normal close is ignored).
41 *
42 * @throws IOException if close fails
43 */
44 public void realClose() throws IOException {
45 super.close();
46 }
47
48 }