Fix IllegalBufferAccessException in the UDT message examples

- Fixes #1104