Java tutorial
/** * @file B64.java * * @author Andrew Stone <andrew@clovar.com> * @copyright 2012-2014 Clear Channel Inc. * * @internal * This file is part of QuickIoClient and is released under * the MIT License: http://opensource.org/licenses/MIT */ package com.iheart.quickio.client; import java.io.UnsupportedEncodingException; import org.apache.commons.codec.binary.Base64; public class B64 { public static String encode(byte[] d) { if (d == null) { return null; } return new String(Base64.encodeBase64(d)).trim(); } }