private boolean doReturnedReading() {
        if (this.ended) return false;

        while (!this.returned.isEmpty()) {
            IByteReader rest;

            while (true) {
                rest = this.returned.getFirst();

                if (rest.isEnded()) this.returned.pollFirst();
                else break;

                if (this.returned.isEmpty()) return true;
            }

            boolean readingRequested = this.listener.apply(rest);

            if (rest.isEnded()) this.returned.pollFirst();

            if (!readingRequested) return false;
        }

        if (this.streamEnded && this.returned.isEmpty()) {
            this.ended = true;
            this.endEvent.event(this.endedStreamError);
        }

        return true;
    }