docs: public void close() throws IOException {
          if (anyAreSet(state, FLAG_CLOSED)) return;
          try {
              state |= FLAG_CLOSED;
              if (anyAreClear(state, FLAG_WRITE_STARTED) && channel == null) {
                  if (buffer == null) {
                      exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, "0");
                  } else {
                      exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, "" + buffer.position());
                  }
              }
              if (buffer != null) {
                  writeBufferBlocking(true);
              }
              if (channel == null) {
                  channel = exchange.getResponseChannel();
              }
              if(channel == null) {
                  return;
              }
              StreamSinkChannel channel = this.channel;
              channel.shutdownWrites();
              Channels.flushBlocking(channel);
          } finally {
              if (pooledBuffer != null) {
                  pooledBuffer.close();
                  buffer = null;
              } else {
                  buffer = null;
              }
          }
      }