@Test
public void testByteBufferToString () {

    ByteBuffer stringBuffer = ByteBuffer.allocate(32);
    String hello = "hello world";
    stringBuffer.put(hello.getBytes());
    String s = ReadWrite.byteBufferToString(stringBuffer);
    Assert.assertEquals(hello, s.trim());
}