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

com.firefly.net.buffer.FixedBufferSizePredictor Maven / Gradle / Ivy

There is a newer version: 5.0.0-dev6
Show newest version
package com.firefly.net.buffer;

import com.firefly.net.BufferSizePredictor;


public class FixedBufferSizePredictor implements
        BufferSizePredictor {

    private final int bufferSize;

    public FixedBufferSizePredictor(int bufferSize) {
        if (bufferSize <= 0) {
            throw new IllegalArgumentException(
                    "bufferSize must greater than 0: " + bufferSize);
        }
        this.bufferSize = bufferSize;
    }

    @Override
    public int nextBufferSize() {
        return bufferSize;
    }

    @Override
    public void previousReceivedBufferSize(int previousReceivedBufferSize) {
        // Ignore
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy