Given a desired buffer size, find the closest positive power-of-two larger than that size.
Given a desired buffer size, find the closest positive power-of-two larger than that size.
This method throws an exception if the given values are negative or too large to have a valid power of two.