{"action":"opened","issue":{"url":"https://api.github.com/repos/tinylib/msgp/issues/104","labels_url":"https://api.github.com/repos/tinylib/msgp/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/tinylib/msgp/issues/104/comments","events_url":"https://api.github.com/repos/tinylib/msgp/issues/104/events","html_url":"https://github.com/tinylib/msgp/issues/104","id":95864759,"number":104,"title":"Add functions to write []byte as MessagePack 'str'","user":{"login":"rin01","id":9582469,"avatar_url":"https://avatars.githubusercontent.com/u/9582469?v=3","gravatar_id":"","url":"https://api.github.com/users/rin01","html_url":"https://github.com/rin01","followers_url":"https://api.github.com/users/rin01/followers","following_url":"https://api.github.com/users/rin01/following{/other_user}","gists_url":"https://api.github.com/users/rin01/gists{/gist_id}","starred_url":"https://api.github.com/users/rin01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rin01/subscriptions","organizations_url":"https://api.github.com/users/rin01/orgs","repos_url":"https://api.github.com/users/rin01/repos","events_url":"https://api.github.com/users/rin01/events{/privacy}","received_events_url":"https://api.github.com/users/rin01/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-18T22:29:51Z","updated_at":"2015-07-18T22:29:51Z","closed_at":null,"body":"Thank you for this extraordinary package.\r\n\r\nWould it be possible to add these two functions that write MessagePack 'str' from []byte ?\r\n\r\n    func (mw *Writer) WriteStringFromBytes(s []byte) error\r\nand\r\n\r\n    func AppendStringFromBytes(b []byte, s []byte) []byte\r\n\r\nIn our application, all strings are stored in []byte buffers, and not in strings, for better performance.\r\nAnd converting them to string just to serialize them as MessagePack 'str' is something we want to avoid.\r\nIndeed, we transmit millions and millions of \"strings\", and the conversion from []byte to string would create a huge volume of garbage.\r\n\r\nI also see that the opposite function already exists for reading string from bytes.\r\n\r\n    func (m *Reader) ReadStringAsBytes(scratch []byte) (b []byte, err error)\r\n\r\nBut there is no correponding function:\r\n\r\n    func ReadStringBytesBytes(b []byte, scratch []byte) (v []byte, o []byte, err error)\r\n"}}