From 41d27351e7c9fb20b67c6421b4bb349b6dbeba84 Mon Sep 17 00:00:00 2001 From: Andrew J Macheret Date: Tue, 21 Aug 2007 00:38:03 +0000 Subject: [PATCH] ICU-5849 Removed the reflection, replaced with preprocessor tags X-SVN-Rev: 22435 --- .../test/perf/ConverterPerformanceTest.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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