ata*_*lor 86
在groovy中执行此操作的首选方法是:
def encoded = "Hello World".bytes.encodeBase64().toString()
assert encoded == "SGVsbG8gV29ybGQ="
def decoded = new String("SGVsbG8gV29ybGQ=".decodeBase64())
assert decoded == "Hello World"
Run Code Online (Sandbox Code Playgroud)
Eva*_*ski 13
Apache Commons有许多实用程序:
二进制包:http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html
下载:http: //commons.apache.org/codec/download_codec.cgi
| 归档时间: |
|
| 查看次数: |
24676 次 |
| 最近记录: |