// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov Date: 2009-01-06 ¿ÀÀü 8:39:16 // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! // Decompiler options: packimports(3) // Source File Name: ByteToCharEUC.java package sun.io; // Referenced classes of package sun.io: // ByteToCharConverter, ConversionBufferFullException, MalformedInputException, UnknownCharacterException public abstract class ByteToCharEUC extends ByteToCharConverter { public ByteToCharEUC() { state = 0; } public void reset() { state = 0; charOff = byteOff = 0; } public int convert(byte abyte0[], int i, int j, char ac[], int k, int l) throws UnknownCharacterException, MalformedInputException, ConversionBufferFullException { int j1 = 65533; byteOff = i; charOff = k; for(; byteOff < j; byteOff++) { int i1 = abyte0[byteOff]; if(i1 < 0) i1 += 256; switch(state) { case 0: // '\0' if(i1 == 142 || i1 == 143) { badInputLength = 1; throw new MalformedInputException(); } if(i1 <= 159) { j1 = byteToCharTable.charAt(i1); } else { if(i1 < 161 || i1 > 254) { badInputLength = 1; throw new MalformedInputException(); } firstByte = i1; state = 1; } break; case 1: // '\001' state = 0; if(i1 < 161 || i1 > 254) { badInputLength = 1; throw new MalformedInputException(); } j1 = mappingTableG1.charAt(((firstByte - 161) * 94 + i1) - 161); break; } if(state != 0) continue; if(j1 == 65533) if(subMode) { j1 = subChars[0]; } else { badInputLength = 1; throw new UnknownCharacterException(); } if(charOff >= l) throw new ConversionBufferFullException(); ac[charOff++] = j1; } return charOff - k; } public int flush(char ac[], int i, int j) throws MalformedInputException { if(state != 0) { reset(); badInputLength = 0; throw new MalformedInputException(); } else { reset(); return 0; } } private final int G0 = 0; private final int G1 = 1; private final int SS2 = 142; private final int SS3 = 143; private int firstByte; private int state; protected String mappingTableG1; protected String byteToCharTable; }