I think resetting the buffer length to 0 might be cheaper than instantiating a new one for every line.