Redirect when asked to read an eeprom file using the "Reader" type.
Signed-off-by: Keith Packard <keithp@keithp.com>
AltosEepromIterable headers;
AltosEepromIterable body;
+ AltosEepromRecordSet set;
AltosState start;
public void write_comments(PrintStream out) {
body.write(out);
}
+ public AltosEepromFile(Reader input) throws IOException {
+ set = new AltosEepromRecordSet(input);
+
+ }
+
public AltosEepromFile(FileInputStream input) {
headers = new AltosEepromIterable(AltosEepromHeader.read(input));
}
public Iterator<AltosState> iterator() {
+ if (set != null)
+ return set.iterator();
+
AltosState state = start.clone();
Iterator<AltosEeprom> i = body.iterator();