Sounds like you might have included a null-terminator in the String. Check their lengths, they're likely different.
Also, this line is wrong:
ByteBuffer arg = ByteBuffer.wrap(new String("hi").getBytes());
This will create a heap ByteBuffer. LWJGL supports direct ByteBuffers only. See the memASCII/memUTF8/memUTF16 methods in MemoryUtil for ways to serialize a String.