protected DicomDirReader(File file, String mode) throws IOException {
this.file = file;
this.raf = new RandomAccessFile(file, mode);
try {
this.in = new DicomInputStream(new RAFInputStreamAdapter(raf));
this.fmi = in.readFileMetaInformation();
this.fsInfo = in.readDataset(-1, Tag.DirectoryRecordSequence);
if (in.tag() != Tag.DirectoryRecordSequence)
throw new IOException("Missing Directory Record Sequence");
} catch (IOException e) {