docs: public void write(final byte[] b, final int off, final int len) throws IOException {
          if (anyAreSet(state, FLAG_CLOSED) || servletRequestContext.getOriginalResponse().isTreatAsCommitted()) {
              throw UndertowServletMessages.MESSAGES.streamIsClosed();
          }
          if (len < 1) {
              return;
          }
  
          if (listener == null) {
              ByteBuffer buffer = buffer();
              if (buffer.remaining() < len) {
                  writeTooLargeForBuffer(b, off, len, buffer);
              } else {
                  buffer.put(b, off, len);
                  if (buffer.remaining() == 0) {
                      writeBufferBlocking(false);
                  }
              }
              updateWritten(len);
          } else {
              writeAsync(b, off, len);
          }
      }