Debian Codegraph @

src/uk/me/parabola/imgfmt/app/ImgReader.java

raw symbols SCIP
1 /*
2 * Copyright (C) 2009.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 or
6 * version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 */
13 package uk.me.parabola.imgfmt.app;
14
15 import java.io.Closeable;
16
17 import uk.me.parabola.imgfmt.Utils;
18 import uk.me.parabola.util.Configurable;
19
20 /**
21 * Base class for all the img sub file reading classes.
22 *
23 * @author Steve Ratcliffe
24 */
25 public abstract class ImgReader implements Closeable, Configurable {
26
27 private CommonHeader header;
28 private ImgFileReader reader;
29
30 public void close() {
31 Utils.closeFile(reader);
32 }
33
34 protected long position() {
35 return reader.position();
36 }
37
38 protected void position(long pos) {
39 reader.position(pos);
40 }
41
42 public CommonHeader getHeader() {
43 return header;
44 }
45
46 protected final void setHeader(CommonHeader header) {
47 this.header = header;
48 }
49
50 protected ImgFileReader getReader() {
51 return reader;
52 }
53
54 protected void setReader(ImgFileReader reader) {
55 this.reader = reader;
56 }
57 }