android.util.Base64 encode/decode flags parameter

后端 未结 2 1060
北海茫月
北海茫月 2021-02-20 02:31

According to the Javadoc, android.util.Base64.decode() takes two parameters: the text, and \"flags\". These flags are in int form and (I quote):

flags controls ce

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-20 02:57

    int flags passed to functions are usually defined to be bitwise ORed to achieve a combined effect.

    You can usually tell by looking at the constant values, they would go 0 1 2 4 8 16 ..

    As for your question you can use the following for your flag definition:

    int flags = Base64.NO_WRAP | Base64.URL_SAFE;
    

提交回复
热议问题