DBCS_IBM_ASCII_Encoder.java revision 2362
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * This code is free software; you can redistribute it and/or modify it
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * under the terms of the GNU General Public License version 2 only, as
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * published by the Free Software Foundation. Oracle designates this
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * particular file as subject to the "Classpath" exception as provided
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * by Oracle in the LICENSE file that accompanied this code.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * This code is distributed in the hope that it will be useful, but WITHOUT
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * version 2 for more details (a copy is included in the LICENSE file that
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * accompanied this code).
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * You should have received a copy of the GNU General Public License version
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * 2 along with this work; if not, write to the Free Software Foundation,
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * or visit www.oracle.com if you need additional information or have any
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * questions.
22eb7cb54d8a6bcf6fe2674cb4b1f0cf2d85cfb6gd * An abstract base class for subclasses which encodes
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * IBM double byte host encodings such as ibm code
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * pages 942,943,948, etc.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowabstract class DBCS_IBM_ASCII_Encoder extends CharsetEncoder
4bff34e37def8a90f9194d81bc345c52ba20086athurlow private byte b1;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow private byte b2;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow protected short index1[];
4bff34e37def8a90f9194d81bc345c52ba20086athurlow protected int mask1;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow protected int mask2;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow protected int shift;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow private final Surrogate.Parser sgp = new Surrogate.Parser();
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Returns true if the given character can be converted to the
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * target character encoding.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow index = index1[((ch & mask1) >> shift)] + (ch & mask2);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow return (true);
4bff34e37def8a90f9194d81bc345c52ba20086athurlow // only return true if input char was unicode null - all others are
4bff34e37def8a90f9194d81bc345c52ba20086athurlow // undefined
4bff34e37def8a90f9194d81bc345c52ba20086athurlow private CoderResult encodeArrayLoop(CharBuffer src, ByteBuffer dst) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (c >= '\uFFFE')
4bff34e37def8a90f9194d81bc345c52ba20086athurlow && c != '\u0000') {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow } finally {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow if (c >= '\uFFFE')
4bff34e37def8a90f9194d81bc345c52ba20086athurlow && c != '\u0000') {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow } finally {