[Solved] Convert Base64 String to String Array


The jsondata value is JSON text. It starts with [, which means it’s a JSON array.

To process it, you should use a JSON parser. See How to parse JSON in Java.

Once you have parsed it, you should have a String[] or a List<String>, with 2 values.

Both values start with data:image/jpeg;base64, followed by Base-64 encoded binary data (JPEG image).

Assuming you have Java 8 or later, use the Base64 class to decode into a byte[].

You now have your 2 JPEG images, in the form of 2 byte arrays.

solved Convert Base64 String to String Array