org.zodiac.sdk.nio.channeling.ChannelingBytesOverFIFOConsumer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zodiac-sdk-nio Show documentation
Show all versions of zodiac-sdk-nio Show documentation
Zodiac SDK NIO2(New Non-Blocking IO)
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);
}