Message objects are immutable.  Unfortunately, readExternal() -- specified
by the Externalizable interface -- is a mutating method.  Implementing it
would destroy the immutability guarantee, possibly introducing bugs or even
security problems.  Is there a way around this?  I admit I'm no expert on
Java serialization (as you might guess, I don't use it! :) ).

On Fri, Feb 12, 2010 at 2:32 AM, yahro <jarek.od...@gmail.com> wrote:

> Hi,
>
> Is there something preventing Protocol Buffer Java classes from being
> serializable e.g. using java.io.Externalizable? I would like to use
> Protocol Buffer classes to store data in caches, data stores etc.
> Currently I have to write awkward custom serializers while it seems,
> that it would be enough to add  add two methods, implement
> java.io.Externalizable interface and classes would be efficiently
> serializable. Am I missing something?
>
> Best regards,
> Jarek
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to