}
@Test
public void testStringtoByteBufferCopy2() {
Benchmark b = new Benchmark("String alloc ByteBuf");
b.mark("begin");
for (int i = 0; i < times; i++) {
byte[] buf = base.getBytes();
ByteBuffer bb = ByteBuffer.allocate(buf.length);
bb.put(buf);
}
b.mark("after " + times);
b.done();
}