Package io.prometheus.client.exporter
Class Base64
- java.lang.Object
-
- io.prometheus.client.exporter.Base64
-
public class Base64 extends java.lang.Object
This class delegates to either javax.xml.bind.DatatypeConverter (for Java < 8) or java.util.Base64 (Java 8+) to perform Base64 encoding of a String. This code requires Java 8+ for compilation.
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
HAS_JAVA_UTIL_BASE64
-
Constructor Summary
Constructors Modifier Constructor Description private
Base64()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
encodeToString(byte[] src)
Encodes a byte[] to a String using Base64.private static boolean
hasJavaUtilBase64()
-
-
-
Method Detail
-
hasJavaUtilBase64
private static boolean hasJavaUtilBase64()
-
encodeToString
public static java.lang.String encodeToString(byte[] src)
Encodes a byte[] to a String using Base64. Passing a null argument will cause a NullPointerException to be thrown.- Parameters:
src
- string to be encoded- Returns:
- String in Base64 encoding
-
-