String assembly by StringBuilder vs StringWriter and PrintWriter

后端 未结 6 1349
孤城傲影
孤城傲影 2020-12-04 16:36

I recently encountered an idiom I haven\'t seen before: string assembly by StringWriter and PrintWriter. I mean, I know how to use them, but I\'ve always used StringBuilder

6条回答
  •  悲&欢浪女
    2020-12-04 16:59

    in this link : http://nohack.eingenetzt.com/java/java-stringwriter-vs-stringbuilder the author shows that the StringWriter is even slightly faster than the StringBuilder.and also said : "So when bigger amounts of data come into play the StringWriter clearly shows its superiority in performance over the StringBuilder."

提交回复
热议问题