提交 e1355a4b 编写于 作者: C Christoph Kutzinski

encode() did an unnecessary indirection via StringWriter

上级 7f1e3421
......@@ -44,7 +44,6 @@ import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -190,9 +189,7 @@ public abstract class ConsoleNote<T> implements Serializable, Describable<Consol
* Works like {@link #encodeTo(Writer)} but obtain the result as a string.
*/
public String encode() throws IOException {
StringWriter sw = new StringWriter();
encodeTo(sw);
return sw.toString();
return encodeToBytes().toString();
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册