Transform a stream into newline separated chunks