I am trying to decode a Base64
encoded string in Android. The string is 751 bytes
long.
byte[] b = Base64.decodeBase64(b_b64);
I am using org.apache.commons.codec.binary.Base64
library for the function.
But I am getting the following exception.
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=255; index=-65
at org.apache.commons.codec.binary.Base64.isBase64(Base64.java:142)
at org.apache.commons.codec.binary.Base64.discardNonBase64(Base64.java:483)
at org.apache.commons.codec.binary.Base64.decodeBase64(Base64.java:379)
What am I missing ?