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

com.firefly.codec.http2.encode.FrameGenerator Maven / Gradle / Ivy

There is a newer version: 5.0.0-dev6
Show newest version
package com.firefly.codec.http2.encode;

import com.firefly.codec.http2.frame.Frame;
import com.firefly.codec.http2.frame.FrameType;

import java.nio.ByteBuffer;
import java.util.List;

public abstract class FrameGenerator {
    private final HeaderGenerator headerGenerator;

    public FrameGenerator(HeaderGenerator headerGenerator) {
        this.headerGenerator = headerGenerator;
    }

    public int getMaxFrameSize() {
        return headerGenerator.getMaxFrameSize();
    }

    protected ByteBuffer generateHeader(FrameType frameType, int length, int flags, int streamId) {
        return headerGenerator.generate(frameType, Frame.HEADER_LENGTH + length, length, flags, streamId);
    }

    public abstract List generate(Frame frame);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy