Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch
Description
There is no need to allocate an array just get it's length.
private void setContentLengthHeader() { if (content == null) { writer.flush(); writer.close(); final int length = sosi.getOutputStream().toByteArray().length; setHeader("Content-Length", length + ""); } else { setHeader("Content-Length", content.getContentLength() + ""); } }
Pull request in github is provided
Attachments
Issue Links
- links to