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

org.zodiac.sdk.nio.channeling.ChannelingBytesOverFIFOConsumer Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.sdk.nio.channeling;

public abstract class ChannelingBytesOverFIFOConsumer implements ChannelingBytesOverConsumer {

    /**
     * @param bytes of over size bytes discard from first
     */

    public void process(byte[][] buffs, int byteCount, byte[] bytes) {
        int targetIndex = byteCount % buffs.length;
        byte[] targetBytes = buffs[targetIndex];
        consume(targetBytes);
        buffs[targetIndex] = bytes;
    }


    /**
     * @param bytes of over size bytes discard
     */
    public abstract void consume(byte[] bytes);
}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy