Base64-encode the given data and return a newly allocated String with the result. @param input the data to encode @param flags controls certain features of the encoded output. Passing DEFAULT results in output that adheres to RFC 2045. @return base64 string containing encoded i
(byte[] input, int flags)
| 413 | * @return base64 string containing encoded input |
| 414 | */ |
| 415 | public static String encodeToString(byte[] input, int flags) { |
| 416 | try { |
| 417 | return new String(encode(input, flags), "US-ASCII"); |
| 418 | } catch (UnsupportedEncodingException e) { |
| 419 | // US-ASCII is guaranteed to be available. |
| 420 | throw new AssertionError(e); |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | /** |
| 425 | * Base64-encode the given data and return a newly allocated String with the result. |