org.pentaho.reporting.libraries.fonts.encoding
Class CodePointUtilities

java.lang.Object
  extended by org.pentaho.reporting.libraries.fonts.encoding.CodePointUtilities

public class CodePointUtilities
extends Object

Creation-Date: 01.06.2006, 18:10:19

Author:
Thomas Morgner

Method Summary
static 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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

public static int[] charsToCodepoint(String text)

codepointToChars

public static String codepointToChars(int[] text)