Example #1
0
 public ManualCodec(IEmittingCodec emittingCodec) : base(typeof(T), emittingCodec)
 {
     calculateSizeDelegate = (CalculateSizeDelegate)CalculateSizeMethod.CreateDelegate(typeof(CalculateSizeDelegate));
     encodeDelegate        = (EncodeDelegate)EncodeMethod.CreateDelegate(typeof(EncodeDelegate));
     decodeDelegate        = (DecodeDelegate)DecodeMethod.CreateDelegate(typeof(DecodeDelegate));
     decodeFastDelegate    = (DecodeDelegate)DecodeFastMethod.CreateDelegate(typeof(DecodeDelegate));
 }
Example #2
0
 public ManualCodec(ICodecContainer codecContainer, IEmittingCodec emittingCodec) : base(typeof(T), emittingCodec)
 {
     this.codecContainer   = codecContainer;
     calculateSizeDelegate = (CalculateSizeDelegate)CalculateSizeMethod.CreateDelegate(typeof(CalculateSizeDelegate));
     encodeDelegate        = (EncodeDelegate)EncodeMethod.CreateDelegate(typeof(EncodeDelegate));
     decodeDelegate        = (DecodeDelegate)DecodeMethod.CreateDelegate(typeof(DecodeDelegate));
     decodeFastDelegate    = (DecodeDelegate)DecodeFastMethod.CreateDelegate(typeof(DecodeDelegate));
 }