for (int i = 0, n = properties.length; i < n; i++) {
CachedProperty property = properties[i];
try {
if (TRACE) trace("kryo", "Writing property: " + property + " (" + type.getName() + ")");
Object value = property.get(object);
Serializer serializer = property.serializer;
if (serializer != null)
serializer.writeObject(buffer, value);
else
kryo.writeClassAndObject(buffer, value);
} catch (IllegalAccessException ex) {
throw new SerializationException("Error accessing getter method: " + property + " (" + type.getName() + ")", ex);
} catch (InvocationTargetException ex) {