553N/A * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 553N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 553N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 553N/A * or visit www.oracle.com if you need additional information or have any 0N/A/** Utility class for static conversion methods between numbers 0N/A * and strings in various formats. 580N/A * <p><b>This is NOT part of any supported API. 580N/A * If you write code that depends on this, you do so at your own risk. 0N/A * This code and its internal interfaces are subject to change or 0N/A * deletion without notice.</b> 0N/A /** Convert string to integer. 0N/A /** Convert string to long integer. 0N/A/* Conversion routines between names, strings, and byte arrays in Utf8 format 0N/A /** Convert `len' bytes from utf8 to characters. 0N/A * Parameters are as in System.arraycopy 0N/A * Return first index in `dst' past the last copied char. 0N/A * @param src The array holding the bytes to convert. 0N/A * @param sindex The start index from which bytes are converted. 0N/A * @param dst The array holding the converted characters.. 0N/A * @param dindex The start index from which converted characters 0N/A * @param len The maximum number of bytes to convert. 0N/A b = (b &
0x0F) <<
12;
0N/A b = b | (
src[i++] &
0x3F) <<
6;
0N/A }
else if (b >=
0xC0) {
0N/A b = (b &
0x1F) <<
6;
0N/A /** Return bytes in Utf8 representation as an array of characters. 0N/A * @param src The array holding the bytes. 0N/A * @param sindex The start index from which bytes are converted. 0N/A * @param len The maximum number of bytes to convert. 0N/A /** Return all bytes of a given array in Utf8 representation 0N/A * as an array of characters. 0N/A * @param src The array holding the bytes. 0N/A /** Return bytes in Utf8 representation as a string. 0N/A * @param src The array holding the bytes. 0N/A * @param sindex The start index from which bytes are converted. 0N/A * @param len The maximum number of bytes to convert. 0N/A /** Return all bytes of a given array in Utf8 representation 0N/A * @param src The array holding the bytes. 0N/A /** Copy characters in source array to bytes in target array, 0N/A * converting them to Utf8 representation. 0N/A * The target array must be large enough to hold the result. 0N/A * returns first index in `dst' past the last copied byte. 0N/A * @param src The array holding the characters to convert. 0N/A * @param sindex The start index from which characters are converted. 0N/A * @param dst The array holding the converted characters.. 0N/A * @param dindex The start index from which converted bytes 0N/A * @param len The maximum number of characters to convert. 0N/A }
else if (
ch <=
0x7FF) {
0N/A dst[j++] = (
byte)(
0x80 | ((
ch >>
6) &
0x3F));
0N/A /** Return characters as an array of bytes in Utf8 representation. 0N/A * @param src The array holding the characters. 0N/A * @param sindex The start index from which characters are converted. 0N/A * @param len The maximum number of characters to convert. 0N/A /** Return all characters in given array as an array of bytes 0N/A * in Utf8 representation. 0N/A * @param src The array holding the characters. 0N/A /** Return string as an array of bytes in in Utf8 representation. 0N/A * Escapes each character in a string that has an escape sequence or 0N/A * is non-printable ASCII. Leaves non-ASCII characters alone. 0N/A * Escapes a character if it has an escape sequence or is 0N/A * non-printable ASCII. Leaves non-ASCII characters alone. 0N/A case '\b':
return "\\b";
0N/A case '\f':
return "\\f";
0N/A case '\n':
return "\\n";
0N/A case '\r':
return "\\r";
0N/A case '\t':
return "\\t";
0N/A case '\'':
return "\\'";
0N/A case '\"':
return "\\\"";
0N/A case '\\':
return "\\\\";
0N/A * Is a character printable ASCII? 0N/A /** Escape all unicode characters in string. 0N/A/* Conversion routines for qualified name splitting 0N/A /** Return the last part of a class name. 0N/A /** Return the package name of a class name, excluding the trailing '.', 0N/A * "" if not existent.