Debian Codegraph @

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

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