isPowerOfTwo property
bool
get
isPowerOfTwo
Whether the byte count is a power of two.
Useful for alignment checks and buffer sizing.
Implementation
bool get isPowerOfTwo {
final bytes = _converter.bytes.toInt();
return bytes > 0 && (bytes & (bytes - 1)) == 0;
}