@Override
        public void write(ByteBuffer buf, CompletionHandler handler) {
            long written = bytesWritten.addAndGet(buf.remaining());
            if (contentLengthHeader != -1 && contentLengthHeader > maxContentSize) {
                handler.failed(new RequestException(
                        HttpStatus.PAYLOAD_TOO_LARGE_413, messageTemplate.formatted(contentLengthHeader, maxContentSize)));
            } else if (written > maxContentSize) {
                handler.failed(new RequestException(
                        HttpStatus.PAYLOAD_TOO_LARGE_413, messageTemplate.formatted(written, maxContentSize)));
            } else {
                delegate.write(buf, handler);
            }
        }
Reads request content from a Jetty {@link Request} and writes it to the {@link ContentChannel}
returned by the {@link com.yahoo.jdisc.handler.RequestHandler}.

@author bjorncs
container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyRequestContentReader.java