msgpack-java icon indicating copy to clipboard operation
msgpack-java copied to clipboard

Add method for packing CharSequence

Open shanielh opened this issue 9 years ago • 1 comments

Hey!

Great library, I would like you to add a method to the packer that knows how to pack CharSequence (almost the same as string) and use it in the "Templates" when it's able to.

Would you like me to do a pull request? If so - Please let me know where to start.

shanielh avatar Oct 19 '16 06:10 shanielh

Hi. Message pack Strings need to be UTF-8. Conversion from CharSequence to UTF8 will add a complexity to the code, so If you can already have byte[] of your CharSequence implementation, I'd recommend to use addPayload() method, etc. For doing I think packStringHeader(byte size) method needs to be added.

xerial avatar Nov 30 '17 23:11 xerial