final Stephenerializable annotation = clazz.getAnnotation(Stephenerializable.class);
if (annotation == null) {
throw new StephenerializationException("The class " + clazz.getName() + " cannot be Stephenerialized "
+ "because it lacks a Stephenerializable annotation.");
} else {
final int version = annotation.version();
final Set<StephenerializableField> fields = getFieldFactory().generateFields(clazz, version);
try {
streamer.writeInt(version); // write the version out to the stream
for (StephenerializableField field : fields) {
writeField(object, clazz, field.getField(), streamer);