Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57509 Improve length check in OutputBuffer.write() to account for 4 extra bytes that are needed to terminates the headers.