Added a toEnd() function to mimic UNIX >> pipe.