I converted text to Base64 byteArray without any problem. Unfortunately, the converted string needs to start with "PD". It means i should encode it to UTF-8 without BOM not with BOM. I started several codes and everything on the net. But, I could not succeed. Any help is appreciated.
Thank you so much.
Regards Alper
public static byte[] convertToByteArray(String strToBeConverted) {
return strToBeConverted.getBytes(StandardCharsets.UTF_8);
}