public static byte[] serialize(Object obj) { ByteArrayOutputStream out = new ByteArrayOutputStream(); try { serialize(obj, out); } catch (IOException e) { throw (new RuntimeException(e)); } return (out.toByteArray()); }