aries / net.globalid.aries.utils.base64 / Base64String

Base64String

abstract class Base64String

This class represents a base64 string. It uses an Android implementation of base64 encoding and decoding, because the one from Java is available only for API >= 26.

NOTE: do not use this class directly in the models, as there is no easy way of determining the correct subclass from JSON string. Use the specific type you expect instead.

Constructors

<init>

This class represents a base64 string. It uses an Android implementation of base64 encoding and decoding, because the one from Java is available only for API >= 26.

Base64String(encoded: String)

Properties

encoded

is the base64 encoded string

val encoded: String

flags

abstract val flags: Int

Functions

toBytes

Returns the base64 URL-safe decoded data as a byte array.

fun toBytes(): ByteArray

toDecodedString

Returns the base64 URL-safe decoded data as a string. An optional offset can be used to skip some bytes.

fun toDecodedString(offset: Int = 0): String

toString

Returns the decoded string.

open fun toString(): String

Inheritors

Base64NormalString

See Base64String. This subclass uses "normal" base64 encoding and decoding. The resulting encoded string is not split into chunks, as is the case when using Base64.DEFAULT mode. Note: the constructor expects an already encoded string. You can use companion object functions to get an encoded string or byte array.

class Base64NormalString : Base64String

Base64UrlString

See Base64String. This subclass uses URL safe base64 encoding and decoding. Note: the constructor expects an already encoded string. You can use companion object functions to get an encoded string or byte array.

class Base64UrlString : Base64String