if (fromDBObject == null) {
return null;
}
if (!((fromDBObject instanceof Binary) || (fromDBObject instanceof byte[]))) {
throw new MappingException(format("The stored data is not a DBBinary or byte[] instance for %s ; it is a %s",
f.getFullName(), fromDBObject.getClass().getName()));
}
try {
final boolean useCompression = !f.getAnnotation(Serialized.class).disableCompression();
return Serializer.deserialize(fromDBObject, useCompression);
} catch (IOException e) {
throw new MappingException("While deserializing to " + f.getFullName(), e);
} catch (ClassNotFoundException e) {
throw new MappingException("While deserializing to " + f.getFullName(), e);
}
}