equal
deleted
inserted
replaced
79 this.fileAccess = fileAccess; |
79 this.fileAccess = fileAccess; |
80 initialize(f); |
80 initialize(f); |
81 } |
81 } |
82 |
82 |
83 private void initialize(File f) throws IOException { |
83 private void initialize(File f) throws IOException { |
84 this.filename = f.getAbsolutePath().toString(); |
84 this.filename = fileAccess.getAbsolutePath(f); |
85 this.file = fileAccess.openRAF(f, "r"); |
85 this.file = fileAccess.openRAF(f, "r"); |
86 this.position = 0; |
86 this.position = 0; |
87 this.size = -1; |
87 this.size = -1; |
88 this.currentBlock.reset(); |
88 this.currentBlock.reset(); |
89 this.previousBlock.reset(); |
89 previousBlock.reset(); |
90 if (f.length() < 8) { |
90 if (fileAccess.length(f) < 8) { |
91 throw new IOException("Not a valid Flight Recorder file. File length is only " + f.length() + " bytes."); |
91 throw new IOException("Not a valid Flight Recorder file. File length is only " + f.length() + " bytes."); |
92 } |
92 } |
93 } |
93 } |
94 |
94 |
95 public RecordingInput(File f, FileAccess fileAccess) throws IOException { |
95 public RecordingInput(File f, FileAccess fileAccess) throws IOException { |