Implemented some stream utilities.