A buffer is just atemporary place to hold data. Fill up an array with things that you read, process it, and then do the output.