ruby-protobuf / protobuf

A pure ruby implementation of Google's Protocol Buffers
https://github.com/ruby-protobuf
MIT License
463 stars 101 forks source link

Read and write with delimiters #342

Closed generall closed 3 years ago

generall commented 8 years ago

Added functions for writing and reading messages with length delimiters.

encode_delimited_to - encodes message to stream with length prefix. Analogue to https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/MessageLite.html#writeDelimitedTo-java.io.OutputStream- decode_delimited_from - reads from stream, created with previous function. Analogue to https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/AbstractParser.html#parseDelimitedFrom-java.io.InputStream-