createSharedString
Encode the String s
in the buffer using UTF-8. If a String with this exact contents has already been serialized using this method, instead simply returns the offset of the existing String.
Usage of the method will incur into additional allocations, so it is advisable to use it only when it is known upfront that your message will have several repeated strings.
Return
The offset in the buffer where the encoded String starts.
Parameters
s
The String to encode.