@Converter
    public static String toString(IoBuffer buffer, Exchange exchange) {
        byte[] bytes = toByteArray(buffer);
        // use type converter as it can handle encoding set on the Exchange
        return exchange.getContext().getTypeConverter().convertTo(String.class, exchange, bytes);
    }
@Test
    public void testToStringTwoTimes() throws UnsupportedEncodingException {
        String in = "Hello World \u4f60\u597d";
        IoBuffer bb = IoBuffer.wrap(in.getBytes(StandardCharsets.UTF_8));
        Exchange exchange = new DefaultExchange(new DefaultCamelContext());
        exchange.setProperty(Exchange.CHARSET_NAME, "UTF-8");

        String out = MinaConverter.toString(bb, exchange);
        assertEquals("Hello World \u4f60\u597d", out);

        // should NOT be possible to convert to string without affecting the ByteBuffer
        out = MinaConverter.toString(bb, exchange);
        assertEquals("", out);
    }