import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.IOException;
import java.io.InputStream;
  public static byte[] getDecode64(String str){
    try{
      return new BASE64Decoder().decodeBuffer(str);
    }catch(IOException ioe){
      logger.error(ioe);
      return null;
    }
  }  public static String getEncode64(byte by[]){
    if(by==null) return null;
    return new BASE64Encoder().encode(by);
  }