Add unit test for truncated ByteBuffer