CipherEncoder.java

net.minecraft.network.CipherEncoder

信息

  • 全限定名:net.minecraft.network.CipherEncoder
  • 类型:public class
  • 包:net.minecraft.network
  • 源码路径:src/main/java/net/minecraft/network/CipherEncoder.java
  • 起始行号:L8
  • 继承:MessageToByteEncoder
  • 职责:

    TODO

字段/常量

  • cipher
    • 类型: CipherBase
    • 修饰符: private final
    • 源码定位: L9
    • 说明:

      TODO

内部类/嵌套类型

构造器

public CipherEncoder(Cipher cipher) @ L11

  • 构造器名:CipherEncoder
  • 源码定位:L11
  • 修饰符:public

参数:

  • cipher: Cipher

说明:

TODO

方法

下面的方法块按源码顺序生成。

protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) @ L15

  • 方法名:encode
  • 源码定位:L15
  • 返回类型:void
  • 修饰符:protected

参数:

  • ctx: ChannelHandlerContext
  • msg: ByteBuf
  • out: ByteBuf

说明:

TODO

代码

public class CipherEncoder extends MessageToByteEncoder<ByteBuf> {
    private final CipherBase cipher;
 
    public CipherEncoder(Cipher cipher) {
        this.cipher = new CipherBase(cipher);
    }
 
    protected void encode(ChannelHandlerContext ctx, ByteBuf msg, ByteBuf out) throws Exception {
        this.cipher.encipher(msg, out);
    }
}

引用的其他类

  • CipherBase
    • 引用位置: 字段/构造调用
    • 关联成员: CipherBase()