spring-framework / org.springframework.util / Base64Utils / encodeToUrlSafeString

encodeToUrlSafeString

open static fun encodeToUrlSafeString(src: ByteArray): String

Base64-encode the given byte array to a String using the RFC 4648 "URL and Filename Safe Alphabet".

Parameters

src - the original byte array

Exceptions

IllegalStateException - if Base64 encoding between byte arrays is not supported, i.e. neither Java 8 nor Apache Commons Codec is present at runtime

Return
the encoded byte array as a UTF-8 String