quote:
Originally posted by Choli
agree with cookie on his format, however i'd improve what is in the quote: Name and comments are human-readable strings, I mean: they have no weird symbols, only characters; so you can use null-terminated strings: The size required would be the same (because you add a null character at the end, but you no longer need the byte identifying the lenght) and this way you can have strings of any size. You may want to have a 500-byte comments on the chunk. In any case, the recommendation of making the name and comments as short as possible still applies.
True, that's also a possebility. But personaly, I don't like to use that because you
need to read and check an unknown amount of bytes until you encounter a null-byte.
The advanatge is indeed that you can have a string longer then 255 bytes, but the disadvantage is that you need to read an X-amount of bytes and check each byte if it is a null-byte.
This implies also that you can't jump easly to a certain part of the file/chunck without checking these null-terminated strings and this is, IMO, a bit messy (but it will work though). For example, If I wanna read a certain chunk, I must process every previous chunk to check if there are comments and how long they are, before I now where the offset is from the chunk I need. If you use a length-identifier, I can jump very easly and quickly thru the chunks...