objSize
Calculates the number of bytes required to encode the given object.
This method analyzes the object and returns the exact number of bytes needed for its binary representation. The size calculation must be deterministic and consistent with the actual encoding performed by encodeObject.
Performance Note: For variable-length data (strings, arrays, nested objects), this may need to traverse the entire object structure. Consider caching results if the same object will be encoded multiple times.
Return
The number of bytes required to encode this object
Parameters
obj
The object to calculate the encoded size for