MCPcopy Create free account
hub / github.com/jwtk/jjwt / encodeToString

Method encodeToString

api/src/main/java/io/jsonwebtoken/io/Base64.java:537–540  ·  view source on GitHub ↗

Encodes a raw byte array into a BASE64 String representation i accordance with RFC 2045. @param sArr The bytes to convert. If null or length 0 an empty array will be returned. @param lineSep Optional "\r\n" after 76 characters, unless end of file. No

(byte[] sArr, boolean lineSep)

Source from the content-addressed store, hash-verified

535 * @return A BASE64 encoded array. Never <code>null</code>.
536 */
537 String encodeToString(byte[] sArr, boolean lineSep) {
538 // Reuse char[] since we can't create a String incrementally anyway and StringBuffer/Builder would be slower.
539 return new String(encodeToChar(sArr, lineSep));
540 }
541
542 /*
543 * Decodes a BASE64 encoded <code>String</code>. All illegal characters will be ignored and can handle both strings with

Callers 1

encodeMethod · 0.45

Calls 1

encodeToCharMethod · 0.95

Tested by

no test coverage detected