3 ms·
I don't see how var_float lets you detect the length of a number field from the input. It seems to be designed to take arbitrary input from another function (wh
by hinkley 6y ago
I don't see how var_float lets you detect the length of a number field from the input. It seems to be designed to take arbitrary input from another function (which has already decided how big the data is out-of-band).
Am I missing something, or can I not read 2 bytes from a file and detect if that's the end of the number or I need to read the next 2 bytes?
- jerf 6y agoI dunno if that specific library has that feature, but it is certainly something that can be implemented. It's just a matter of programming.
- afiori 6y agoyes, that is half of how utf8 works as an encoding: the first byte of a unit is either 0xxxxxxx or 11xxxxxx, in the first it is a single ascii byte and in the second case all the following bytes that start with 10xxxxxx are part of the same unit. for this purpose it would be enough to revert the order of the stream.