encode
Encodes bytes from the specified source array or its subrange. Returns a string with the resulting symbols.
If the size of the source array or its subrange is not an integral multiple of 3, the result is padded with '='
to an integral multiple of 4 symbols.
Use encodeToByteArray to get the output in ByteArray form.
Since Kotlin
1.8Return
a string with the resulting symbols.
Parameters
source
the array to encode bytes from.
startIndex
the beginning (inclusive) of the subrange to encode, 0 by default.
endIndex
the end (exclusive) of the subrange to encode, size of the source array by default.
Throws
when startIndex or endIndex is out of range of source array indices.
when startIndex > endIndex
.