try {
// read header
@SuppressWarnings("unused")
JWFDanceFileHeader header = (JWFDanceFileHeader) in.readObject();
// read data
DancingFlameProject project = new DancingFlameProject();
@SuppressWarnings("unchecked")
List<Flame> flames = (List<Flame>) in.readObject();
@SuppressWarnings("unchecked")
List<Motion> motions = (List<Motion>) in.readObject();
String soundFilename = (String) in.readObject();
RecordedFFT fft = (RecordedFFT) in.readObject();
project.getFlames().addAll(flames);
project.getMotions().addAll(motions);
project.setSoundData(soundFilename, fft);
return project;
}
finally {
in.close();
}