public static ByteBuffer toByteBuffer(String s) {
        /*
        ByteBuffer buffer = ByteBuffer.allocateDirect(s.length());
        buffer.put(s.getBytes(UTF_8));
        buffer.flip();
        return buffer;
        */
        return ByteBuffer.wrap(s.getBytes(UTF_8));
    }
@Test
    public void testToByteBuffer1() {
        String s = "こんにちは";
        ByteBuffer bb = NioUtils.toByteBuffer(s);
        String n = new String(bb.array(), StandardCharsets.UTF_8);
        Assert.assertEquals(s, n);
    }