From: Keith Packard Date: Tue, 9 May 2017 07:20:23 +0000 (-0700) Subject: altoslib: Hack up AltosEepromFile to support new eeprom code X-Git-Tag: 1.8~130 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=c00a80f040de85be18c9d5150cb0661e08158c3d altoslib: Hack up AltosEepromFile to support new eeprom code Redirect when asked to read an eeprom file using the "Reader" type. Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosEepromFile.java b/altoslib/AltosEepromFile.java index 5544ec37..bb8abf87 100644 --- a/altoslib/AltosEepromFile.java +++ b/altoslib/AltosEepromFile.java @@ -58,6 +58,7 @@ public class AltosEepromFile extends AltosStateIterable { AltosEepromIterable headers; AltosEepromIterable body; + AltosEepromRecordSet set; AltosState start; public void write_comments(PrintStream out) { @@ -69,6 +70,11 @@ public class AltosEepromFile extends AltosStateIterable { body.write(out); } + public AltosEepromFile(Reader input) throws IOException { + set = new AltosEepromRecordSet(input); + + } + public AltosEepromFile(FileInputStream input) { headers = new AltosEepromIterable(AltosEepromHeader.read(input)); @@ -130,6 +136,9 @@ public class AltosEepromFile extends AltosStateIterable { } public Iterator iterator() { + if (set != null) + return set.iterator(); + AltosState state = start.clone(); Iterator i = body.iterator();