code: public static String encode(byte[] bytes) {
      if (null == bytes) {
        return null;
      }
      ByteArrayOutputStream out = new ByteArrayOutputStream((int) (bytes.length * 1.37));
      Base64Encoder encodedOut = new Base64Encoder(out);
  
      try {
        encodedOut.write(bytes);
        encodedOut.close();
  
        return out.toString("UTF-8");
      } catch (IOException ignored) {
        return null;
      }
    }
docs: *
  Returns the encoded form of the given unencoded string.
  
  @param bytes the bytes to encode
  @return the encoded form of the unencoded string