spring-framework / org.springframework.util / Base64Utils

Base64Utils

abstract class Base64Utils

A simple utility class for Base64 encoding and decoding.

Adapts to Java 8's java.util.Base64 in a convenience fashion.

Author
Juergen Hoeller

Author
Gary Russell

Since
4.1

See Also
java.util.Base64

Constructors

<init>

Base64Utils()

A simple utility class for Base64 encoding and decoding.

Adapts to Java 8's java.util.Base64 in a convenience fashion.

Functions

decode

open static fun decode(src: ByteArray): ByteArray

Base64-decode the given byte array.

decodeFromString

open static fun decodeFromString(src: String): ByteArray

Base64-decode the given byte array from an UTF-8 String.

decodeFromUrlSafeString

open static fun decodeFromUrlSafeString(src: String): ByteArray

Base64-decode the given byte array from an UTF-8 String using the RFC 4648 "URL and Filename Safe Alphabet".

decodeUrlSafe

open static fun decodeUrlSafe(src: ByteArray): ByteArray

Base64-decode the given byte array using the RFC 4648 "URL and Filename Safe Alphabet".

encode

open static fun encode(src: ByteArray): ByteArray

Base64-encode the given byte array.

encodeToString

open static fun encodeToString(src: ByteArray): String

Base64-encode the given byte array to a String.

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".

encodeUrlSafe

open static fun encodeUrlSafe(src: ByteArray): ByteArray

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