using DotNetty.Buffers; using DotNetty.Codecs; using DotNetty.Transport.Channels; using log4net; using Service.TBox.Msg; namespace Service.TBox.Codec; public class Encoder : MessageToByteEncoder { private static readonly ILog Log = LogManager.GetLogger(typeof(Encoder)); /// /// /// /// /// /// protected override void Encode(IChannelHandlerContext context, BaseMsg obj, IByteBuffer output) { byte[] bytes = obj.ToBytes(); output.WriteBytes(bytes); } }