3 ms·
But look at the encoding, they compact the int down to the amount of bytes it needs for storage. There is no space to encode the type, and there is no way to di
by iso8859-1 6y ago
But look at the encoding, they compact the int down to the amount of bytes it needs for storage. There is no space to encode the type, and there is no way to distinguish encoded uint from an int. You must layer your own schema on top.
- 8organicbits 6y agoI 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.