Closed Garfield100 closed 1 year ago
Hi Enrico, good catch, and hopefully it didn't cause too much frustration! I think this error must have crept in when the spec was originally converted to GitHub wiki format. Indeed, this originally said [1, 4, or 8]
just like the other variable-length encoded integers (that's why there's still a comma after the 4).
Edit: fixed now
It seems to me as if the spec and the minimal.xdf example file in the linked example_files repo disagree. While writing a new xdf parser, I tried reading values according to this: Structure of Value
I made sure to assert as much as possible in general, including the following from the linked paragraphs:
For non-numeric (i.e., string or binary) values, a variable-length encoding is used:
Here, the number of length bytes is specified to be either 4, or 8. However, my program throws an error because this is not the case in minimal.xdf:
As you can see, the length of the string
Hello
is given by only a single byte,05
.I checked the commits on the wiki and the specified
[4, or 8]
was already in the initial commit. Strangely though, there was also a1
but it wasn't inside the square brackets:As such, it was removed in the following clean-up commit. I'm not sure how the wiki came to be or why the first commit looked the way it did. Perhaps the 1 was supposed to stay and be included in the square brackets?
Is the file or the spec outdated or otherwise wrong? Have I missed something else entirely?