Class CodePointUtilities
java.lang.Object
org.pentaho.reporting.libraries.fonts.encoding.CodePointUtilities
Creation-Date: 01.06.2006, 18:10:19
- Author:
- Thomas Morgner
-
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
charsToCodepoint
(String text) static String
codepointToChars
(int[] text) static boolean
isValidCodePoint
(int cp) static int
toChars
(int cp, char[] buffer, int offset) Converts the given codepoint into the given character array.
-
Method Details
-
isValidCodePoint
public static boolean isValidCodePoint(int cp) -
toChars
public static int toChars(int cp, char[] buffer, int offset) Converts the given codepoint into the given character array. The return value indicates either success or failure. The conversion will fail, if the given array does not contain enough space for the decoded character. In that case either -1 (one char missing) or -2 (two chars missing) is returned. On success either 1 or 2 is returned to indicate the number of chars added. If the buffer has space for at least two chars, then the negative index will never be returned.- Parameters:
cp
-buffer
-offset
-- Returns:
- the number of chars added or the number of additional chars required.
-
charsToCodepoint
-
codepointToChars
-