fastjson flush of SerializeWriter should empty it's internal buffer data

2nbm6dog  于 2021-11-27  发布在  Java
关注(0)|答案(0)|浏览(157)

public void flush() {
if (writer == null) {
return;
}
try {
writer.write(buf, 0, count);
writer.flush();
} catch (IOException e) {
throw new JSONException(e.getMessage(), e);
}
count = 0;
}

=> make count to zero always

if (writer != null) {
try {
writer.write(buf, 0, count);
writer.flush();
} catch (IOException e) {
throw new JSONException(e.getMessage(), e);
}
}
count = 0;
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题