StringCoding.java revision 0
3909N/A * Copyright 2000-2006 Sun Microsystems, Inc. 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 2362N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Sun 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. 2362N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2362N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * Utility class for string encoding and decoding. 3323N/A /* The cached coders for each thread 0N/A // Trim the given byte array to the given length 964N/A // Trim the given char array to the given length 0N/A // We need to perform double, not float, arithmetic; otherwise 0N/A // we lose low order bits when len is larger than 2**24. 0N/A // Use sun.misc.MessageUtils rather than the Logging API or 0N/A // System.err since this method may be called during VM 0N/A // initialization before either is available. 0N/A " not supported, using ISO-8859-1 instead");
964N/A // Substitution is always enabled, 964N/A // so this shouldn't happen 964N/A // If this code is hit during VM initialization, MessageUtils is 964N/A // the only way we will be able to get any kind of error message. 964N/A // If we can not find ISO-8859-1 (a required encoding) then things 964N/A // are seriously wrong with the installation. 0N/A // Substitution is always enabled, 0N/A // so this shouldn't happen 964N/A // If this code is hit during VM initialization, MessageUtils is 964N/A // the only way we will be able to get any kind of error message. 964N/A // If we can not find ISO-8859-1 (a required encoding) then things 964N/A // are seriously wrong with the installation.