public byte[] serialize(Object value, ValueFields valueFields) { if (value == null) { return null; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = createObjectOutputStream(baos); oos.writeObject(value); } catch (Exception e) { throw new ActivitiException("Couldn't serialize value '"+value+"' in variable '"+valueFields.getName()+"'", e); } finally { IoUtil.closeSilently(oos); } return baos.toByteArray(); }
public static byte[] serialize(Object value, ValueFields valueFields) { if(value == null) { return null; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream ois = null; try { ois = createObjectOutputStream(baos); ois.writeObject(value); } catch (Exception e) { throw new ActivitiException("Couldn't serialize value '"+value+"' in variable '"+valueFields.getName()+"'", e); } finally { IoUtil.closeSilently(ois); } return baos.toByteArray(); }
public byte[] serialize(Object value, ValueFields valueFields) { if (value == null) { return null; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = createObjectOutputStream(baos); oos.writeObject(value); } catch (Exception e) { throw new ActivitiException("Couldn't serialize value '"+value+"' in variable '"+valueFields.getName()+"'", e); } finally { IoUtil.closeSilently(oos); } return baos.toByteArray(); }
public byte[] serialize(Object value, ValueFields valueFields) { if (value == null) { return null; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { oos = createObjectOutputStream(baos); oos.writeObject(value); } catch (Exception e) { throw new ActivitiException("Couldn't serialize value '" + value + "' in variable '" + valueFields.getName() + "'", e); } finally { IoUtil.closeSilently(oos); } return baos.toByteArray(); }