[protobuf] [java] serialize to the static buffer

2013-04-23 Thread adam.h
Hi Protobufs Apostles,

There is nice function to deserialize from the buffer - mergeFrom(buf, 
offs, size), but how can you serialize similar way? I do not see anything 
like writeTo(buf, offs, size). 

I would like to avoid allocating bytes[] each time when serializing message 
- so what is proper way to achieve it?

Thanks,
Adam

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [protobuf] [java] serialize to the static buffer

2013-04-23 Thread adam.h
great, thanks for this hint!

/A.

W dniu środa, 24 kwietnia 2013 00:17:08 UTC+2 użytkownik Oliver napisał:


 https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/CodedOutputStream.html#newInstance(byte[],
  
 int, int)


 On Tue, Apr 23, 2013 at 7:12 PM, adam.h adam.p...@gmail.com javascript:
  wrote:

 Hi Protobufs Apostles,

 There is nice function to deserialize from the buffer - mergeFrom(buf, 
 offs, size), but how can you serialize similar way? I do not see anything 
 like writeTo(buf, offs, size). 

 I would like to avoid allocating bytes[] each time when serializing 
 message - so what is proper way to achieve it?

 Thanks,
 Adam

 -- 
 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 javascript:.
 To post to this group, send email to prot...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/protobuf?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.