TypeReasonJava.IO.IOExceptionif an error occurs while closing this writer.
Calling this method has no effect. In contrast to most Writer subclasses, the other methods in StringWriter do not throw an IOException if close() has been called.
[Android Documentation]