org.mozilla.jss.util
public class UTF8Converter extends Object
Method Summary | |
---|---|
static void | main(String[] args)
Testing method |
static byte[] | UnicodeToUTF8(char[] unicode)
Creates a new UTF8-encoded byte array representing the
char[] passed in. |
protected static byte[] | UnicodeToUTF8(char[] unicode, boolean nullTerminate)
Do the work of the above functions. |
static byte[] | UnicodeToUTF8NullTerm(char[] unicode)
Creates a new null-terminated UTF8-encoded byte array representing the
char[] passed in.
|
static void | wipeBytes(byte[] array)
Wipes a byte array by setting all of its bytes to zero. |
This call is safe for passwords; all internal buffers are cleared. The output array is the owned by the caller, who has responsibility for clearing it.
See http://www.stonehard.com/unicode/standard/ for the UTF-16 and UTF-8 standards.
Parameters: unicode An array of Unicode characters, which may have UCS4 characters encoded in UTF-16. This array must not be null.
Throws: CharConversionException If the input characters are invalid.
This call is safe for passwords; all internal buffers are cleared. The output array is the owned by the caller, who has responsibility for clearing it.
See http://www.stonehard.com/unicode/standard/ for the UTF-16 and UTF-8 standards.
Parameters: unicode An array of Unicode characters, which may have UCS4 characters encoded in UTF-16. This array must not be null.
Throws: CharConversionException If the input characters are invalid.
Parameters: array The input array must not be null.