What is the correct way to "empty" a StringWriter in Java so that I can reuse the StringWriter without having to create a new one? Neither StringWriter.flush() nor StringWriter.close() seem to have the desired effect.
StringWriter
StringWriter.flush()
StringWriter.close()
How about calling getBuffer().setLength(0)?
getBuffer().setLength(0)
1.4m articles
1.4m replys
5 comments
57.0k users