System.out.println("--Test Unicode to "+encoding+" --PASSED");
System.out.println("--Test convertAll() Unicode to "+encoding+" --PASSED");
      public static void testConvertAll(String encoding){        {            try{                //char[] myTarget = new char[gbSource.length];                byte[] mySource = new byte[gbSource.length];                int i=0;                while(i<gbSource.length){                    mySource[i]=(byte) gbSource[i];                    i++;                }                ByteToCharConverter gbConv = ByteToCharConverterICU.createConverter(encoding);                char[] myTarget=gbConv.convertAll(mySource);                //gbConv.convert(mySource, 0, mySource.length, myTarget, 0, myTarget.length);                i=0;                char[] expectedResult = uSource;                boolean passed =true;                while( i<expectedResult.length){                    if(myTarget[i]!= expectedResult[i]){                        StringBuffer temp = new StringBuffer("Error:  Expected: ");                        temp.append(Integer.toHexString(expectedResult[i]));                        temp.append(" Got: ");                        temp.append(Integer.toHexString(myTarget[i]));                        System.out.println(temp);                        passed =false;                    }                    i++;                }                if(passed){                    System.out.println("--Test "+encoding+" to Unicode --PASSED");                }else{                    System.out.println("--Test "+encoding+" to Unicode  --FAILED");                }                            }            catch(UnsupportedEncodingException ueEx){                System.out.println(ueEx.toString());            }            catch (MalformedInputException miEx){                System.out.println(miEx.toString());            }        }        {             try{                //byte[] myTarget = new byte[uSource.length * 5];                 CharToByteConverter myConv = CharToByteConverterICU.createConverter(encoding);                //myConv.convert(uSource, 0, uSource.length, myTarget, 0, myTarget.length);                byte[] myTarget= myConv.convertAll(uSource);                int i=0;                char[] expectedResult = gbSource;                boolean passed =true;                while(i<myTarget.length){                    if(myTarget[i]!=(byte)expectedResult[i]){                        StringBuffer temp = new StringBuffer("Error:  Expected: ");                        temp.append(Integer.toHexString(expectedResult[i]));                        temp.append(" Got: ");                        temp.append(Integer.toHexString(myTarget[i]));                        System.out.println(temp);                        passed =false;                        passed =false;                    }                    i++;                }                if(passed){                    System.out.println("--Test Unicode to "+encoding+" --PASSED");                }else{                    System.out.println("--Test Unicode to "+encoding+" --FAILED");                }                System.gc();            }            catch(UnsupportedEncodingException ueEx){                System.out.println(ueEx.toString());            }            catch (MalformedInputException miEx){                System.out.println(miEx.toString());            }                       }      }