changing ContentOutputStream so it is binary safe