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.
|
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 encodingCopyright © 1998–2022 iText Group NV. All rights reserved.