CipherEncoder .java

net.minecraft.network.CipherEncoder (class, 19 lines): members: cipher, encode. imports: MessageToByteEncoder, ChannelHandlerContext, ByteBuf.

net.minecraft.networkclass19 linescommonextends MessageToByteEncoder<ByteBuf>535 B

API Surface (1)

void encode(final ChannelHandlerContext ctx, final ByteBuf msg, final ByteBuf out)

Fields & Constants (1)

cipher

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

CipherEncoder.java19 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network;
2
3
import io.netty.buffer.ByteBuf;
4
import io.netty.channel.ChannelHandlerContext;
5
import io.netty.handler.codec.MessageToByteEncoder;
6
import javax.crypto.Cipher;
7
8
public class CipherEncoder extends MessageToByteEncoder<ByteBuf> {
9
	private final CipherBase cipher;
10
11
	public CipherEncoder(final Cipher cipher) {
12
		this.cipher = new CipherBase(cipher);
13
	}
14
15
	protected void encode(final ChannelHandlerContext ctx, final ByteBuf msg, final ByteBuf out) throws Exception {
16
		this.cipher.encipher(msg, out);
17
	}
18
}
19

Decompiled Minecraft 26.3 source of CipherEncoder (net/minecraft/network/CipherEncoder.java) with Mojang official mappings, stored verbatim on the site.