byte[] arr = out.toByteArray();
start = System.currentTimeMillis();
writerName = writerName.intern();
for (int i=0; i<decIter; i++) {
ResponseParser rp = null;
if (writerName == "xml") {
rp = new XMLResponseParser();
} else if (writerName == "javabin") {
rp = new BinaryResponseParser();
} else {
break;
}
ByteArrayInputStream in = new ByteArrayInputStream(arr);
rp.processResponse(in, "UTF-8");
}
long decodeTime = Math.max(System.currentTimeMillis() - start, 1);
System.out.println("writer "+writerName+", size="+out.size()+", encodeRate="+(encodeTime==1 ? "N/A": ""+(encIter*1000L/encodeTime)) + ", decodeRate="+(decodeTime==1 ? "N/A": ""+(decIter*1000L/decodeTime)) );