IoUtil.closeSilently(bufferedWriter);
}
}
protected Object deserializeFromByteArray(byte[] bytes, String objectTypeName) throws Exception {
DataFormatMapper mapper = dataFormat.getMapper();
DataFormatReader reader = dataFormat.getReader();
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
InputStreamReader inReader = new InputStreamReader(bais, Context.getProcessEngineConfiguration().getDefaultCharset());
BufferedReader bufferedReader = new BufferedReader(inReader);
try {
Object mappedObject = reader.readInput(bufferedReader);
return mapper.mapInternalToJava(mappedObject, objectTypeName);
}
finally{
IoUtil.closeSilently(bais);
IoUtil.closeSilently(inReader);
IoUtil.closeSilently(bufferedReader);