Class CharsetEncodingUtils
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.util.CharsetEncodingUtils
-
public class CharsetEncodingUtils extends java.lang.Object
Utility class related to encoding characters into (UTF-8) byte sequences.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
encodeAsUTF8(java.lang.String input)
LikeString.getBytes(java.nio.charset.Charset)
(with "UTF-8"), except that encoding problems (like unpaired surrogates) are reported as exceptions (seeCodingErrorAction.REPORT
, instead of being silently replaces as it would happen otherwise.
-
-
-
Method Detail
-
encodeAsUTF8
public static byte[] encodeAsUTF8(java.lang.String input) throws java.io.IOException
LikeString.getBytes(java.nio.charset.Charset)
(with "UTF-8"), except that encoding problems (like unpaired surrogates) are reported as exceptions (seeCodingErrorAction.REPORT
, instead of being silently replaces as it would happen otherwise.- Parameters:
input
- String to encode- Returns:
- String encoded using
StandardCharsets.UTF_8
- Throws:
java.io.IOException
- on encoding error
-
-