Base64Utils { public static byte[] decode(String s) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { decode(s, bos); } catch (IOException e) { throw new RuntimeException(); } byte[] decodedBytes = bos.toByteArray(); try { bos.close(); bos = null; } catch (IOException ex) { System.err.println("Error while decoding BASE64: " + ex.toString()); } return decodedBytes; }  static String encode(byte[] data); static byte[] decode(String s); String bitmapToBase64(Bitmap bitmap); Bitmap base64ToBitmap(String base64);  }
@Test public void decode() throws Exception { System.out.println(TAG + " >>>>>>>> decode "); byte[] decodeValue = Base64Utils.decode(TEST_RESULT); String decodeString = new String(decodeValue); System.out.println(TAG + " >> decode >> string >> " + TEST_RESULT); System.out.println(TAG + " >> decode >> decodeValue >> " + decodeString); System.out.println(TAG + " >> decode >> targetDecodeValue >> " + TEST_STRING); System.out.println(); assertEquals(decodeString, TEST_STRING); }