java.lang.IllegalArgumentException: bad base-64

后端 未结 3 871
野趣味
野趣味 2021-01-21 00:01

I am trying to encode and decode a String using android.util.Base64, but it gives a bad base-64 error.

The code with the problem is:

private byte[] base         


        
3条回答
  •  迷失自我
    2021-01-21 00:33

    It hit me, if in any case your are splitting the data & the encoding it, then decode it first before putting it back together.. Stupidly I was doing decode after collation of data that left me "bad-base-64" as each block of encode data had file enders(==).

    This is Linkis handy anyways to validate the encoding and decoding.

提交回复
热议问题