Example #1
0
        public CodeExpression GetReaderExpression(CodeExpression reader)
        {
            CodeExpression ret = CodeGen.CallMethod(reader, "ReadBytes", CodeGen.GetPrimitive(_bytes.Length));

            if (_validate)
            {
                ret = CodeGen.CallMethod(CodeGen.GetThis(), "CMP", ret, CodeGen.CreateByteArray(_bytes));
            }

            return(ret);
        }
Example #2
0
 public CodeExpression GetWriterExpression(CodeExpression writer, CodeExpression obj)
 {
     return(CodeGen.CallMethod(writer, "Write", CodeGen.CreateByteArray(_bytes)));
 }