Correct the usage of ByteBuffer for test