public final class EncodingUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
convertToBytes(char[] chars,
String encoding)
Converts to byte array an array of chars, taking the provided encoding into account.
|
static String |
convertToString(byte[] bytes,
String encoding)
Converts to String an array of bytes, taking the provided encoding into account.
|
static byte[] |
fromBase64(String base64)
Decodes base64 string into byte array with tolerance to new lines and spaces.
|
static String |
toBase64(byte[] bytes)
Encodes byte array to base64 string.
|
public static byte[] convertToBytes(char[] chars,
String encoding)
throws CharacterCodingException
chars - an array of chars to be converted to bytesencoding - the encoding to be taken into account while converting the provided array of charsCharacterCodingException - if anything goes wrong while encodingpublic static String convertToString(byte[] bytes, String encoding) throws UnsupportedEncodingException
bytes - an array of bytes to be converted to Stringencoding - the encoding to be taken into account while converting the provided bytesUnsupportedEncodingException - if anything goes wrong while encodingpublic static byte[] fromBase64(String base64)
base64 - base64 string to decodepublic static String toBase64(byte[] bytes)
bytes - the byte array to encodeCopyright © 1998–2025 Apryse Group NV. All rights reserved.