Improve performance when padding: don't write a byte at a time.