Skip to content

Commit e70ea6b

Browse files
committed
reuse the PrintWriter
1 parent 38edfda commit e70ea6b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

framework/src/main/java/org/tron/core/services/filter/BufferedResponseWrapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public void setWriteListener(WriteListener writeListener) {
6666
}
6767
};
6868

69+
private final PrintWriter writer = new PrintWriter(outputStream, true);
70+
6971
/**
7072
* @param response the wrapped response
7173
* @param maxBytes max allowed response bytes; {@code 0} means no limit
@@ -116,7 +118,7 @@ public ServletOutputStream getOutputStream() {
116118

117119
@Override
118120
public PrintWriter getWriter() {
119-
return new PrintWriter(outputStream, true);
121+
return writer;
120122
}
121123

122124
public void commitToResponse() throws IOException {

0 commit comments

Comments
 (0)