{"action":"opened","issue":{"url":"https://api.github.com/repos/protobuf-php/protobuf/issues/13","repository_url":"https://api.github.com/repos/protobuf-php/protobuf","labels_url":"https://api.github.com/repos/protobuf-php/protobuf/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/protobuf-php/protobuf/issues/13/comments","events_url":"https://api.github.com/repos/protobuf-php/protobuf/issues/13/events","html_url":"https://github.com/protobuf-php/protobuf/issues/13","id":180684007,"number":13,"title":"Add support for message delimiting","user":{"login":"rwchhs","id":15850815,"avatar_url":"https://avatars.githubusercontent.com/u/15850815?v=3","gravatar_id":"","url":"https://api.github.com/users/rwchhs","html_url":"https://github.com/rwchhs","followers_url":"https://api.github.com/users/rwchhs/followers","following_url":"https://api.github.com/users/rwchhs/following{/other_user}","gists_url":"https://api.github.com/users/rwchhs/gists{/gist_id}","starred_url":"https://api.github.com/users/rwchhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwchhs/subscriptions","organizations_url":"https://api.github.com/users/rwchhs/orgs","repos_url":"https://api.github.com/users/rwchhs/repos","events_url":"https://api.github.com/users/rwchhs/events{/privacy}","received_events_url":"https://api.github.com/users/rwchhs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-03T16:23:57Z","updated_at":"2016-10-03T16:23:57Z","closed_at":null,"body":"Google's Java implementation of protobuf provides the writeDelimitedTo/parseDelimitedFrom methods, basically just prefixing individual messages with their length and thus allowing multiple messages to be combined in one output stream.\r\n\r\nI've been trying to cobble this together myself, but I think it would be nice to have as part of the library as well. This would make API creation using your library much easier, since you might wanna support requests querying multiple resources/messages of one kind.\r\n\r\nIf you're not likely to implement this, could you maybe point me in the right direction for doing this myself? It's no problem for small messages (where the length fits into 8 bytes)\r\n\r\n```php \r\npack(\"c*\", strlen($message->toStream()));\r\n```\r\n\r\nbut for larger messages, packing with v* or V* fails, because their length needs to be converted to a varint."}}
{"actor":{"display_login":"rwchhs"}}