ByteArrayOutputStream bout = new ByteArrayOutputStream();ObjectOutputStream oout = new ObjectOutputStream(bout);oout.writeObject(edinSerializeObject);byte [] data = bout.toByteArray();oout.close();