diff --git a/icu4j/src/com/ibm/icu/dev/test/perf/ConverterPerformanceTest.java b/icu4j/src/com/ibm/icu/dev/test/perf/ConverterPerformanceTest.java index a41b6c4563a..3e61bdabdb5 100644 --- a/icu4j/src/com/ibm/icu/dev/test/perf/ConverterPerformanceTest.java +++ b/icu4j/src/com/ibm/icu/dev/test/perf/ConverterPerformanceTest.java @@ -18,6 +18,8 @@ import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; import java.nio.charset.CodingErrorAction; +import sun.io.CharToByteConverter; + import com.ibm.icu.charset.CharsetProviderICU; /** @@ -44,10 +46,25 @@ public class ConverterPerformanceTest extends PerfTest { encoder.onUnmappableCharacter(CodingErrorAction.REPORT); ByteBuffer target = encoder.encode(source); + CharToByteConverter conv = CharToByteConverter.getConverter("UTF-8"); + conv.setSubstitutionMode(false); + byte[] encBuffer2 = conv.convertAll(unicodeBuffer); + + boolean b = true; // target.array() will probably return what we want, but lets take no chances encBuffer = new byte[target.limit()]; - for (int i=0; i