ParseFromArray vs ParseFromString

683 views
Skip to first unread message

sahil goyal

unread,
Apr 7, 2015, 8:09:41 PM4/7/15
to prot...@googlegroups.com
What is the difference between ParseFromArray and ParseFromString? Is there any limitation on the data, how much there API's can serialize and de-serialize?

Feng Xiao

unread,
Apr 7, 2015, 8:17:58 PM4/7/15
to sahil goyal, Protocol Buffers
On Tue, Apr 7, 2015 at 1:22 AM, sahil goyal <sahilg...@gmail.com> wrote:
What is the difference between ParseFromArray and ParseFromString? Is there any limitation on the data, how much there API's can serialize and de-serialize?
ParseFromString(value) is the same as ParseFromArray(value.data(), value.size()). Protobuf uses int32 to store size/length information, so the maximum a message can be is 2G bytes. The library will start to give warnings once the size exceeds a much smaller limit though:
 

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages