I think this doesn't fit inside any existing wire-type, which means there
is no protocol-compliant way of adding such data. You could create your own
fork that adds a custom wire-type (there are a couple of unused values),
but it would no longer be protobuf and would not be compatible with any
implementation, so you'd also need to rework all the read/write logic on
any platforms that you're using. IMO that would be a terrible idea, and
you'd be better off just using a varint and eating the extra byte for
values in the range 128-255.

On Mon, 10 Mar 2025, 17:39 jawad arbahi, <[email protected]> wrote:

> Hello everyone, I want to create my own data types in Protocol Buffers
> (protobuf). For example, I need a UInt8 (1-byte unsigned integer). If I
> want to add this data type, can I use *add-ons* or fork protobuf and
> customize it for my needs? What do you think?
>
> --
> 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 [email protected].
> To view this discussion visit
> https://groups.google.com/d/msgid/protobuf/0602b674-482e-4da5-a9a6-9031908d27a0n%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/0602b674-482e-4da5-a9a6-9031908d27a0n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/protobuf/CAF95VAxE3z6_C3VvKZTmhCHRRs1u4sv_ac4kP%3D2E18un_vpRvw%40mail.gmail.com.

Reply via email to