public void reset() {
        if (aborted) {
            return;
        }
        lock.lock();
        try {
            setInputMode();
            buffer().clear();
            endStream = false;
        } finally {
            lock.unlock();
        }
    }
TODO: to be replaced by core functionality
httpclient5/src/main/java/org/apache/hc/client5/http/impl/compat/AbstractSharedBuffer.java