Ensures buffer is big enough to hold a specified capacity.