Ditching the StringBuilder and writing directly to the underlying stream.