2362N/A * Copyright (c) 1996, 1999, 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 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/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. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A private static final int ASCII =
0;
// ESC ( B 0N/A // JIS is state full encoding, so currentMode keep the 0N/A * Bytes for substitute for unmappable input. 0N/A // XXX: Assumes subBytes are ASCII string. Need to change Escape sequence 0N/A // for other character sets. 0N/A // Buffer for output bytes 0N/A // Make copies of input and output indexes 0N/A // This is legal UTF16 sequence. 0N/A // This is illegal UTF16 sequence. 0N/A // Loop until we run out of input 0N/A // Get the input character 0N/A // Is this a high surrogate? 0N/A // Is this the last character of the input? 0N/A // Is there a low surrogate following? 0N/A // We have a valid surrogate pair. Too bad we don't do 0N/A // surrogates. Is substitution enabled? 0N/A // We have a malformed surrogate pair 0N/A // Is this an unaccompanied low surrogate? 0N/A // Not part of a surrogate 0N/A // Does this map to the Roman range? 0N/A // Is it a single byte kana? 0N/A // Is it a yen sign? 0N/A // Is it a JIS-X-0208 character? 0N/A // It doesn't map to JIS-0208! 0N/A // Is there room in the output buffer? 0N/A // XXX: The code assumes output buffer can hold at least 5 bytes, 0N/A // in this coverter case. However, there is no way for apps to 0N/A // see how many bytes will be necessary for next call. 0N/A // getMaxBytesPerChar() should be overriden in every subclass of 0N/A // CharToByteConverter and reflect real value (5 for this). 0N/A // Put the output into the buffer 0N/A // Advance the input pointer 0N/A // We can successfuly output the characters, changes 0N/A // current mode. Fix for 4251646. 0N/A // return mode ASCII at the end 0N/A // Return the length written to the output buffer 0N/A * returns the maximum number of bytes needed to convert a char 0N/A // Return the character set ID