@Override
    public boolean hasCacheReachedEndOfStream() {
        /* The cache has reached EOS,
         * either if the last segment is in the future cache,
         * or of the last segment is currently played back.
         */
        int lastSegmentNumber = mRepresentation.segments.size() - 1;
        return mFutureCache.containsKey(lastSegmentNumber)
                || mCurrentSegment >= lastSegmentNumber;
    }
Tries to switch to the next segment and returns true if there is one, false if there is none
and thus the current is the last one.
MediaPlayer-DASH/src/main/java/net/protyposis/android/mediaplayer/dash/DashMediaExtractor.java