private double time_step;
private double ground_altitude;
private ArrayList<Integer> bytes;
+ String name;
class FileEndedException extends Exception {
public void save (OutputStream f) throws IOException {
for (int c : bytes)
f.write(c);
+ f.write('\n');
}
- public MicroData (InputStream f) throws IOException {
+ public void set_name(String name) {
+ this.name = name;
+ }
+
+ public MicroData (InputStream f, String name) throws IOException, InterruptedException {
+ this.name = name;
bytes = new ArrayList<Integer>();
if (!find_header(f))
- throw new IOException();
+ throw new IOException("No MicroPeak data header found");
try {
file_crc = 0xffff;
ground_pressure = get_32(f);
time_step = 0.192;
} catch (FileEndedException fe) {
- throw new IOException();
+ throw new IOException("File Ended Unexpectedly");
} catch (NonHexcharException ne) {
- throw new IOException();
+ throw new IOException("Non hexadecimal character found");
}
}