change to unix eol style
use null to denote stream closed