2016-11-02 41 views
-1

我試圖使用org.apache.commons.codec.binary.Base64Base64編碼字符串轉換爲字節數組工作不字節數組正常

byte[] image = Base64.decodeBase64("Base64 String"); 

爲Base64字符串轉換成字節數組,然後轉換爲Base64像

String Base64String = Base64.encodeBase64String(image); 

但base64String與原始base64字符串不同。我不明白,我錯在哪裏

+0

不同以什麼方式?你能給出具體的輸入,你期望的輸出和你得到的輸出嗎? – RealSkeptic

+0

它以何種方式不同?它與[NOTE:]有什麼關係(https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html#encodeBase64String(byte []) ))在Javadoc? –

+0

不同如何?你能向我們展示一個*小例子嗎? – Andreas

回答

-1

使用encodeBase64不encodeBase64String。

相關問題