01: /*
02: * Readerjava Copyright (c) 2006,07 Swaroop Belur
03: *
04: * This program is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License
06: * as published by the Free Software Foundation; either version 2
07: * of the License, or (at your option) any later version.
08:
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13:
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17: *
18: */
19: package net.sf.jdec.io;
20:
21: import java.io.DataInputStream;
22: import java.io.FileNotFoundException;
23:
24: import net.sf.jdec.exceptions.IOError;
25:
26: public abstract class Reader {
27:
28: /* (non-Javadoc)
29: * @see java.io.Reader#close()
30: */
31:
32: protected static DataInputStream instream = null;
33:
34: public static net.sf.jdec.io.Reader createStreamReader(String path) {
35: try {
36: return new FileReader(path);
37: } catch (FileNotFoundException fne) {
38: throw new IOError("File Specified By " + path
39: + " not found....");
40: }
41:
42: }
43:
44: public abstract String toString();
45:
46: public abstract DataInputStream getStreamReader();
47:
48: protected String whoami = null;
49:
50: }
|