class WriteProgressListener extends WriteListener implements ChannelProgressiveFutureListener {

    private final long expectedTotal;
    private long lastProgress;

    public WriteProgressListener(NettyResponseFuture<?> future, boolean notifyHeaders, long expectedTotal) {
        super(future, notifyHeaders);
        this.expectedTotal = expectedTotal;
    }

    @Override
    public void operationComplete(ChannelProgressiveFuture cf) {
        operationComplete(cf.channel(), cf.cause());
    }

    @Override
    public void operationProgressed(ChannelProgressiveFuture f, long progress, long total) {<FILL_FUNCTION_BODY>}
}

        future.touch();

        if (progressAsyncHandler != null && !notifyHeaders) {
            long lastLastProgress = lastProgress;
            lastProgress = progress;
            if (total < 0) {
                total = expectedTotal;
            }
            if (progress != lastLastProgress) {
                progressAsyncHandler.onContentWriteProgress(progress - lastLastProgress, progress, total);
            }
        }
    
<methods><variables>private static final Logger LOGGER,protected final non-sealed NettyResponseFuture<?> future,final non-sealed boolean notifyHeaders,final non-sealed ProgressAsyncHandler<?> progressAsyncHandler