public final class Base64 extends Object
A simple Base64 encoding class that only supports the operations needed by
Spokestack. This custom implementation exists to maintain both backwards
compatibility and testability for Spokestack: Base64
was
only introduced in Java 8 and is unavailable for older Android API versions.
Using the Android variant makes Base64 encoding, thus, request signing
untestable since the Base64 encoding method would have to be mocked.
Modifier and Type | Method and Description |
---|---|
static String |
encode(byte[] bytes)
Encode a byte array into a Base64-encoded UTF-8 string.
|
public static String encode(byte[] bytes)
The implementation is adapted from OpenJDK's Base64.Encoder
.
It does not support:
bytes
- The byte array to encode.Copyright © 2020. All rights reserved.