public byte[] serializeToByte(final Object target) throws Exception
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
OutputStream oos = new ObjectOutputStream(baos);
JBossObjectOutputStream jbos = new JBossObjectOutputStream(oos);
jbos.writeObject(target);
jbos.close();
return baos.toByteArray();
}