A pre-allocated char[] avoid memory issues, I think it is quicker and more robust.