Java XML Data Type Converter serializeLogic(Serializable logic)

Here you can find the source of serializeLogic(Serializable logic)

Description

serialize Logic

License

Open Source License

Declaration

public static String serializeLogic(Serializable logic) 

Method Source Code

//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);
        }
    }
}

Related

  1. printZahl20(BigInteger value)
  2. printZahl31(BigDecimal value)
  3. printZimmeranzahl(BigDecimal value)
  4. readKey(Reader reader, String algorithm)
  5. sendJson(URL url, String method, String data, String user, String password)
  6. serializeToString(Object object)
  7. serializeURLSafe(String string)
  8. stringToCalendar(String value)
  9. stringToData(String data)