add variant of printMultiLine which counts the number of output bytes