All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mageddo.tobby.internal.utils.Base64 Maven / Gradle / Ivy

There is a newer version: 2.1.6-alpha
Show newest version
package com.mageddo.tobby.internal.utils;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class Base64 {

  public static String encodeToString(byte[] data) {
    if (data == null) {
      return null;
    }
    return java.util.Base64.getEncoder()
        .encodeToString(data);
  }

  public static byte[] decode(String data) {
    if (StringUtils.isBlank(data)) {
      return null;
    }
    return java.util.Base64.getDecoder()
        .decode(data);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy