Grow buffer only as much as it is required.