/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
public class ISO2022_CN
extends Charset
implements HistoricallyNamedCharset
{
public ISO2022_CN() {
}
return "ISO2022CN";
}
|| (cs instanceof ISO2022_CN));
}
return new Decoder(this);
}
throw new UnsupportedOperationException();
}
public boolean canEncode() {
return false;
}
private boolean shiftOut;
private byte currentSODesig;
shiftOut = false;
}
protected void implReset() {
shiftOut= false;
}
int p = 0;
p = 1; //plane 2, index -- 1
p = 2; //plane 3, index -- 2
else
return REPLACE_CHAR; //never happen.
byte2 & 0xff,
p);
return REPLACE_CHAR;
return ret[0];
}
byte2 & 0xff);
} else { // SOD == SODesigCNS
byte2 & 0xff,
0);
return REPLACE_CHAR;
return ret[0];
}
}
{
int inputSize = 0;
char c = REPLACE_CHAR;
try {
while (src.hasRemaining()) {
inputSize = 1;
return CoderResult.UNDERFLOW;
inputSize++;
if (b2 == (byte)0x24) {
return CoderResult.UNDERFLOW;
inputSize++;
} else if (b3 == ')') {
return CoderResult.UNDERFLOW;
inputSize++;
} else {
}
} else if (b3 == '*') {
return CoderResult.UNDERFLOW;
inputSize++;
//SS2Desig -> CNS-P1
}
} else if (b3 == '+') {
return CoderResult.UNDERFLOW;
inputSize++;
//SS3Desig -> CNS-P2.
}
} else {
}
return CoderResult.UNDERFLOW;
inputSize += 2;
return CoderResult.OVERFLOW;
//SS2->CNS-P2, SS3->CNS-P3
if (c == REPLACE_CHAR)
} else {
}
shiftOut = true;
shiftOut = false;
}
return CoderResult.UNDERFLOW;
inputSize = 1;
}
return CoderResult.OVERFLOW;
if (!shiftOut) {
} else {
return CoderResult.UNDERFLOW;
inputSize++;
if (c == REPLACE_CHAR)
}
}
return CoderResult.UNDERFLOW;
} finally {
}
}
{
int inputSize = 0;
char c = REPLACE_CHAR;
try {
inputSize = 1;
return CoderResult.UNDERFLOW;
inputSize++;
if (b2 == (byte)0x24) {
return CoderResult.UNDERFLOW;
inputSize++;
/* <ESC>$A is not a legal designator sequence for
ISO2022_CN, it is listed as an escape sequence
for GB2312 in ISO2022-JP-2. Keep it here just for
the sake of "compatibility".
*/
} else if (b3 == ')') {
return CoderResult.UNDERFLOW;
inputSize++;
} else {
}
} else if (b3 == '*') {
return CoderResult.UNDERFLOW;
inputSize++;
}
} else if (b3 == '+') {
return CoderResult.UNDERFLOW;
inputSize++;
}
} else {
}
return CoderResult.UNDERFLOW;
}
return CoderResult.OVERFLOW;
}
inputSize += 2;
if (c == REPLACE_CHAR)
} else {
}
shiftOut = true;
shiftOut = false;
}
return CoderResult.UNDERFLOW;
inputSize = 1;
}
return CoderResult.OVERFLOW;
}
if (!shiftOut) {
} else {
return CoderResult.UNDERFLOW;
inputSize++;
if (c == REPLACE_CHAR)
}
}
return CoderResult.UNDERFLOW;
} finally {
}
}
{
else
}
}
}