package com.hig.utils;

import java.util.Base64;

public class Base64Coder {
	public static String Encode(byte[] bytes)
	{
		return Base64.getEncoder().encodeToString(bytes);
	}

	public static byte[] Decode(String basestr) throws Exception
	{
		try {
			return Base64.getDecoder().decode(basestr);
		} catch (IllegalArgumentException e) {
			throw new Exception(e.getMessage());
		}
	}
}