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 bytes
encoding
- the encoding to be taken into account while converting the provided array of chars
CharacterCodingException
- if anything goes wrong while encoding
public static String convertToString(byte[] bytes, String encoding) throws UnsupportedEncodingException
bytes
- an array of bytes to be converted to String
encoding
- the encoding to be taken into account while converting the provided bytes
UnsupportedEncodingException
- if anything goes wrong while encoding
Copyright © 1998–2022 iText Group NV. All rights reserved.