The important part is to convert the values from the query into the actual data type before writing into the data stream.
You likely also want a "header" like in the other direction, e.g. a number that indicates the size of the message to wait for before decoding.
Cheers,
_
Bookmarks