/*
* 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.
*/
/**
* @author Tom Zhou
*/
{
private boolean shiftout;
public void reset()
{
int i = 0;
shiftout = false;
firstByte = 0;
curSODes = 0;
curSS2Des = 0;
curSS3Des = 0;
remainIndex = -1;
remainByte[i] = 0;
}
throws MalformedInputException
{
int i;
badInputLength = 0;
throw new MalformedInputException();
}
reset();
return 0;
}
{
int i;
byte tmp[];
else
return tmp;
}
{
char[] tmpChar = new char[1];
switch(shiftFlag) {
case SOFlag:
try {
}
catch (Exception e) {}
break;
case SS2Flag:
try {
}
catch (Exception e){}
break;
case SS3Flag:
try {
}
catch (Exception e){}
break;
default:
}
return tmpChar[0];
}
throws ConversionBufferFullException,
{
int i;
int DesignatorLength = 0;
// Loop until we hit the end of the input
// If we don't have room for the output, throw an exception
throw new ConversionBufferFullException();
if(remainIndex < 0) {
remainIndex = 0;
byteOff++;
}
switch (remainByte[0]) {
case ISO_SO:
shiftout = true;
if(remainIndex > 0)
remainIndex--;
break;
case ISO_SI:
shiftout = false;
if(remainIndex > 0)
remainIndex--;
break;
case ISO_ESC:
break;
curSODes = i;
break;
}
}
throw new MalformedInputException();
}
if (i == SODesignator.length) {
curSS2Des = i;
break;
}
}
if(i == SS2Designator.length) {
curSS3Des = i;
break;
}
}
if (i == SS3Designator.length) {
switch(remainByte[1]) {
case ISO_SS2_7:
remainByte[3],
SS2Flag);
charOff++;
DesignatorLength = 3;
break;
case ISO_SS3_7:
remainByte[3],
SS3Flag);
charOff++;
DesignatorLength = 3;
break;
default:
DesignatorLength = 0;
}
}
}
}
if (remainIndex > DesignatorLength) {
remainIndex = i-1;
} else {
remainIndex = -1;
}
break;
default:
if (!shiftout) {
charOff++;
} else {
switch (state) {
case G0:
break;
case G1:
SOFlag);
charOff++;
break;
}
}
if (remainIndex > 0)
remainIndex--;
}
}
}
public ByteToCharISO2022CN()
{
try {
} catch (Exception e) {};
}
// Return the character set id
{
return "ISO2022CN";
}
}