* @param fudgeContext the Fudge context, not null
* @param inputFile the input file, not null
*/
private static Map<String, ? extends FudgeMsg> loadFile(FudgeContext fudgeContext, File inputFile) {
Map<String, MutableFudgeMsg> dataMap = new ConcurrentHashMap<String, MutableFudgeMsg>();
FudgeMsgReader reader = null;
try {
FileInputStream fis = new FileInputStream(inputFile);
reader = fudgeContext.createMessageReader(fis);
while (reader.hasNext()) {
FudgeMsg msg = reader.nextMessage();
LoggedReferenceData loggedData = fudgeContext.fromFudgeMsg(LoggedReferenceData.class, msg);
addDataToMap(fudgeContext, dataMap, loggedData);
}
} catch (FileNotFoundException ex) {
throw new OpenGammaRuntimeException("Cannot open " + inputFile + " for reading");
} finally {
if (reader != null) {
reader.close();
}
}
reflectTickersToBUIDs(dataMap);
return dataMap;
}