/**
* Read a snapshot from the specified stream. Apply the snapshot to the FastBlobStateEngine supplied in the constructor of this class.
*/
public void readSnapshot(InputStream is) throws IOException {
FastBlobHeader header = readHeader(is);
StreamingByteData byteData = getStreamingByteData(is, header.getDeserializationBufferSizeHint());
DataInputStream dis = new DataInputStream(byteData);
int numTypes = header.getNumberOfTypes();
if(stateEngine.getLatestVersion() == null) {
readSnapshotTypes(byteData, dis, numTypes);
}
///The version must be set *after* the changes are applied. This will protect against
///bad data in the event of an Exception midway through parsing.
stateEngine.setLatestVersion(header.getVersion());
}