protected final Subfile parseSubfileCommonHeader(int subfileOffset) throws ParseException {
Subfile subfile = null;
// Subfile common header
SubfileCommonHeader commonHeader = new SubfileCommonHeader();
// Subfile headers length
commonHeader.setHeadersLength(getLittleEndianWord(2));
// Subfile type
commonHeader.setType(SubfileType.getType(parseString(10)));
switch (commonHeader.getType()) {
case RGN: subfile = new SubfileRGN(); break;
case TRE: subfile = new SubfileTRE(); break;
case LBL: subfile = new SubfileLBL(); break;
case NOD: subfile = new SubfileNOD(); break;
case NET: subfile = new SubfileNET(); break;
case MDR: subfile = new SubfileMDR(); break;
default: subfile = new SubfileNone(); break;
}
subfile.setOffset(subfileOffset);
subfile.setCommonHeader(commonHeader);
// 0x01 x1
skipBytes(1);
// Subfile lock status
if (nextByte() == 0) {
commonHeader.setLockStatus(SubfileLockStatus.NOT_LOCKED);
} else {
commonHeader.setLockStatus(SubfileLockStatus.LOCKED);
}
// Subfile creation date
commonHeader.setCreationDate(parseDate());
return subfile;
}