// Generated by delombok at Tue Dec 16 19:36:13 UTC 2025
package net.md_5.bungee.netty.cipher;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import net.md_5.bungee.jni.cipher.BungeeCipher;

public class CipherEncoder extends MessageToByteEncoder<ByteBuf> {
    private final BungeeCipher cipher;

    @Override
    protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) throws Exception {
        cipher.cipher(in, out);
    }

    @Override
    public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
        cipher.free();
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public CipherEncoder(final BungeeCipher cipher) {
        this.cipher = cipher;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public BungeeCipher getCipher() {
        return this.cipher;
    }
}
