enjoy 3.5

This commit is contained in:
James 2018-08-14 23:11:21 +08:00
parent 462c70b692
commit 8d88d0bba4

View File

@ -97,7 +97,7 @@ public class FastStringWriter extends Writer {
} }
static int MAX_SIZE = 1024 * 128; static int MAX_SIZE = 1024 * 64;
/** /**
* StringWriter.close() 改造而来原先该方法中无任何代码 改造如下 * StringWriter.close() 改造而来原先该方法中无任何代码 改造如下
@ -107,7 +107,7 @@ public class FastStringWriter extends Writer {
*/ */
public void close() { public void close() {
if (buf.length() > MAX_SIZE) { if (buf.length() > MAX_SIZE) {
buf = new StringBuilder(); // 释放空间占用过大的 buf buf = new StringBuilder(MAX_SIZE / 2); // 释放空间占用过大的 buf
} else { } else {
buf.setLength(0); buf.setLength(0);
} }