An empty batch or array must still contain a valid 8 byte header. This header will be a big-endian 32-bit unsigned item count, which in this case will be zero, followed by a big-endian 32-bit unsigned item size.
Can the item size also be zero? - Strictly speaking no, it should be the same as the size which would be used if the batch or array were not empty. However it is considerably easier (and currently common) to set the size to zero as well. Because of this decoders should be designed to cope with a zero size if the count is zero. Encoders should correctly complete the size if possible as this reduces the possibility of incompatibility.
Can the header be omitted? - No, it is required and most decoders will fail in some way or other if an item of type "batch" or "array" contains no header
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum