Here you can find the source of serializeLogic(Serializable logic)
public static String serializeLogic(Serializable logic)
//package com.java2s; /*/*from w ww. jav a 2 s .c om*/ # Licensed Materials - Property of IBM # Copyright IBM Corp. 2015 */ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.io.Serializable; import javax.xml.bind.DatatypeConverter; public class Main { public static String serializeLogic(Serializable logic) { try { ByteArrayOutputStream bao = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bao); oos.writeObject(logic); oos.flush(); return DatatypeConverter.printBase64Binary(bao.toByteArray()); } catch (IOException e) { throw new RuntimeException(e); } } }