File metaDataFile = Serialization.getMetaDataFile(file);
if(metaDataFile.exists()) {
return new LogFileV3.MetaDataWriter(file, logFileID);
}
logFile = new RandomAccessFile(file, "r");
int version = logFile.readInt();
if(Serialization.VERSION_2 == version) {
return new LogFileV2.MetaDataWriter(file, logFileID);
}
throw new IOException("File " + file + " has bad version " +
Integer.toHexString(version));