3 ms·
I believe this is the docs that explain their type byte. That information is stored: https://google.github.io/flatbuffers/flatbuffers_internals.html https://go
by 8organicbits 6y ago
I believe this is the docs that explain their type byte. That information is stored:
https://google.github.io/flatbuffers/flatbuffers_internals.html https://google.github.io/flatbuffers/flatbuffers_internals.h...
> A type byte is made up of 2 components (see flexbuffers.h for exact values):
> * 2 lower bits representing the bit-width of the child (8, 16, 32, 64). This is only used if the child is accessed over an offset, such as a child vector. It is ignored for inline types.
> * 6 bits representing the actual type (see flexbuffers.h).
> Thus, in this example 4 means 8 bit child (value 0, unused, since the value is in-line), type SL_INT (value 1).
Type aware methods like `.isInt()` wouldn't make sense if they couldn't determine the underlying type.