public static TrieProvider create(String fileName) throws IOException {
File file = new File(fileName);
if (file.exists()) {
FileInputStream stream = new FileInputStream(file);
TrieReader reader = new TrieReader(stream.getChannel());
// Check the version number is correct for this API.
//Version version = new Version(reader.readInt(), reader.readInt(),
// reader.readInt(), reader.readInt());
int version = reader.readUShort();
// Add this
/*if (version != BinaryConstants.FormatVersion.Major)
{
throw new MobileException(String.Format(
"Version mismatch. Data is version '{0}' for '{1}' reader",
version,
BinaryConstants.FormatVersion.Major));
}*/
// Create the new provider.
return new TrieProvider(
new String(reader.readBytes((int) reader.readUInt())),
ReadStrings(reader),
ReadProperties(reader),
ReadDevices(reader),
ReadLookupList(reader),
reader.readLong(),
reader.getPos(),
fileName);
} else {
return null;
}