All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kolibrifx.plovercrest.server.internal.folds.PeekableInputStream Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2010-2017, KolibriFX AS. Licensed under the Apache License, version 2.0.
 */

package com.kolibrifx.plovercrest.server.internal.folds;

import com.kolibrifx.plovercrest.server.streams.StreamDataTriggerer;

public interface PeekableInputStream {
    boolean hasNext();

    long nextTimestamp();

    void consumeNext(FoldCallback cb);

    /**
     * Conditionally registerer the given (one-off) data triggerer. This will only be done if:
     * 
    *
  • There is no unconsumed element buffered up. *
  • The last poll operation (triggered by hasNext()) failed; in order words, the underlying * stream reached the end. *
* If these conditions are not met, calling this function is a no-op. This makes it safe to call * this function for each {@link PeekableInputStream} in a fold: it will only be activated for * those that actually lack data. *

* * @return true if the the triggerer was registered, or possibly invoked inline, * false otherwise. */ boolean registerDataTriggererIfReachedEnd(StreamDataTriggerer dataTriggerer); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy