Number of Bits Written to Memory

16 views
Skip to first unread message

Tanya

unread,
Feb 3, 2011, 11:58:21 AM2/3/11
to Protocol Buffers
Hi, we are looking at replacing a XML/JAXB project with something
similar to protocol buffers, especially since it's multi-platform, but
there are a couple of concerns we have seen that would prevent us from
switching. I'd like to verify that what we think is actually true
before passing on what seems to be a very cool solution Google has
come up with.

My main question revolves around how the bytes are stored. In our
current solution, we store by bit, so some items have very strange
amounts of bits being stored (i.e. 5 bits, 14 bits). We noticed that
protocol buffers seem to only store by byte or word (very even amounts
of bits) and have a unique way of encoding.

Basically, we need some way of specifying how the bytes are encoded/
written to memory, and we need to specify the number of bits written
each time. Is this possible to do in protocol buffers? And if so, how
would it be accomplished?

Thanks. Any help is greatly appreciated.

Brian Palmer

unread,
Feb 4, 2011, 4:21:08 PM2/4/11
to Tanya, Protocol Buffers
On Thu, Feb 3, 2011 at 8:58 AM, Tanya <turt...@gmail.com> wrote:
Basically, we need some way of specifying how the bytes are encoded/
written to memory, and we need to specify the number of bits written
each time. Is this possible to do in protocol buffers? And if so, how
would it be accomplished?

Hi, Tanya. I'm not a protocol buffer expert at all, and you know your problem domain best, of course, but are you sure that you've fully identified your needs? You can use protocol buffers as data storage where you access fields, and you can use them to efficiently transmit data across the wire, but protobufs don't seem well suited to this sort of micromanaged control that you're talking about.


Kenton Varda

unread,
Feb 22, 2011, 1:20:26 PM2/22/11
to Tanya, Protocol Buffers
Protobufs provide their own encoding.  You can't control exactly how the bytes are written, unless you write your own encoder, which would defeat the purpose.

On Thu, Feb 3, 2011 at 8:58 AM, Tanya <turt...@gmail.com> wrote:

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


Reply all
Reply to author
Forward
0 new messages