getStaticSize method

  1. @override
int getStaticSize()
override

Returns the static size in bytes for encoding. For dynamic types, this returns 32 (the offset pointer size). For static types, this returns the actual encoded size.

Implementation

@override
int getStaticSize() {
  // Dynamic arrays are encoded as offset pointer (32 bytes)
  if (isDynamic) return 32;
  // Fixed-size arrays with static elements: length * element size
  return length! * elementType.getStaticSize();
}