protected Header readHeader(BufferedReader reader)
throws IOException, UnsupportedFormatException {
Header header = new Header();
LOG.debug("trying to read VERSION");
KeyValue keyValue = IOUtils.readValue(reader, null, VERSION, false);
if (!"1".equals(keyValue.getValue())) {
throw new UnsupportedFormatException("expected version 1 (found:" +
keyValue.getValue() + ")");
}
header.setVersion(keyValue.getValue());
keyValue = IOUtils.readValue(reader, keyValue, CID, false);
header.setContentID(Long.valueOf(keyValue.getValue(), 16));
keyValue = IOUtils.readValue(reader, keyValue, PARENT_CID, false);
header.setParentContentID(Long.parseLong(keyValue.getValue(), 16));
keyValue = IOUtils.readValue(reader, keyValue, CREATE_TYPE, true);
header.setCreateType(CreateType.valueOf(keyValue.getValue()));
return header;
}