Response的OutputStream和Writer
public ServletOutputStream getOutputStream() throws IOException {
if (this.servletOutputStream == null) {
this.servletOutputStream = new ServletOutputStreamAdapter(this.exchange.getResponseBody());
}
return this.servletOutputStream;
}
public PrintWriter getWriter() throws IOException {
if (this.writer == null) {
if (this.characterEncoding != null) {
this.writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(this.exchange.getResponseBody(), this.characterEncoding)));
}
else {
this.writer = new PrintWriter(this.exchange.getResponseBody());
}
}
return this.writer;
}
所以用完以后要关闭