diff options
author | Keith Packard <keithp@keithp.com> | 2017-05-09 02:31:04 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-05-09 02:31:04 -0700 |
commit | 0641326842bffbf4b3ae69459ca540131cb64e59 (patch) | |
tree | 31231c75d916a978de51c4f303af516e147de115 /altoslib/AltosStateIterable.java | |
parent | 17e20a6d2dab1f4bd1375bfd9e1c5230ee2c1119 (diff) |
altoslib: Remove older eeprom handling code
The new code appears to work in minor testing; time to try it all the time.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altoslib/AltosStateIterable.java')
-rw-r--r-- | altoslib/AltosStateIterable.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/altoslib/AltosStateIterable.java b/altoslib/AltosStateIterable.java index 5332aecd..ec3d944d 100644 --- a/altoslib/AltosStateIterable.java +++ b/altoslib/AltosStateIterable.java @@ -29,15 +29,13 @@ public abstract class AltosStateIterable implements Iterable<AltosState> { public abstract void write(PrintStream out); public static AltosStateIterable iterable(File file) { - FileInputStream in; try { - in = new FileInputStream(file); + if (file.getName().endsWith("telem")) + return new AltosTelemetryFile(new FileInputStream(file)); + else + return new AltosEepromFile(new FileReader(file)); } catch (Exception e) { return null; } - if (file.getName().endsWith("telem")) - return new AltosTelemetryFile(in); - else - return new AltosEepromFile(in); } } |