}
String encoded = "";
if (data != null) {
Transcoder transcoder = getTranscoder(format);
try {
encoded = transcoder.encode(data, name, properties);
} catch (RuntimeException e) {
// convert failure to UOE
throw new UnsupportedOperationException("Failure encoding data ("+data+") of type ("+data.getClass()+"): " + e.getMessage(), e);
}
}