return dataFormat.getMapper().getCanonicalTypeName(deserializedObject);
}
protected byte[] serializeToByteArray(Object deserializedObject) throws Exception {
DataFormatMapper mapper = dataFormat.getMapper();
DataFormatWriter writer = dataFormat.getWriter();
ByteArrayOutputStream out = new ByteArrayOutputStream();
OutputStreamWriter outWriter = new OutputStreamWriter(out, Context.getProcessEngineConfiguration().getDefaultCharset());
BufferedWriter bufferedWriter = new BufferedWriter(outWriter);
try {
Object mappedObject = mapper.mapJavaToInternal(deserializedObject);
writer.writeToWriter(bufferedWriter, mappedObject);
return out.toByteArray();
}
finally {
IoUtil.closeSilently(out);
IoUtil.closeSilently(outWriter);