com.iheart.quickio.client.B64.java Source code

Java tutorial

Introduction

Here is the source code for com.iheart.quickio.client.B64.java

Source

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