protected static void Initialize(String pEncoding){ encoding = pEncoding; byteToChar = new char[256]; validByte = new boolean[256]; charToByte = new byte[256*256]; byte[] val = new byte[1]; char[] charArray = null; for (int i=0; i< 256; i++){ val[0] = (byte) i; try { charArray = new String(val, 0,1, encoding).toCharArray(); byteToChar[i] = charArray[0]; charToByte[byteToChar[i]] = (byte) i; } catch (java.io.UnsupportedEncodingException uee){ uee.printStackTrace(); }
protected static void Initialize(String encoding, char[] byteToChar , byte[] charToByte){ byte[] val = new byte[1]; char[] charArray = null; for (int i=0; i< 256; i++){ val[0] = (byte) i; try { charArray = new String(val, 0,1, encoding).toCharArray(); byteToChar[i] = charArray[0]; charToByte[byteToChar[i]] = (byte) i; } catch (java.io.UnsupportedEncodingException uee){ uee.printStackTrace();
        protected static void Initialize(String pEncoding){            encoding = pEncoding;            byteToChar = new char[256];            validByte = new boolean[256];            charToByte = new byte[256*256];            byte[] val = new byte[1];            char[] charArray = null;            for (int i=0; i< 256; i++){                val[0] = (byte) i;                try {                    charArray = new String(val, 0,1, encoding).toCharArray();                    byteToChar[i] = charArray[0];                    charToByte[byteToChar[i]] = (byte) i;                }                catch (java.io.UnsupportedEncodingException uee){                    uee.printStackTrace();                }            }        }