docs: private MethodCode getSizeMethodCode() {
          MethodCode mc = new MethodCode();
          mc.setName("size");
          mc.setScope(ClassCode.SCOPE_PUBLIC);
          mc.setReturnType("int");
          mc.addParameter(ClassHelper.getInternalName(cls.getCanonicalName()), "t");
          mc.addException("IOException");
  
          // add method code
          mc.appendLineCode1("int size = 0");
  
          Set<Integer> orders = new HashSet<Integer>();
          // encode method
          for (FieldInfo field : fields) {
  
              boolean isList = field.isList();
  
              // check type
              if (!isList) {
                  checkType(field.getFieldType(), field.getField());
              }
  
              if (orders.contains(field.getOrder())) {
                  throw new IllegalArgumentException("Field order '" + field.getOrder() + "' on field"
                          + field.getField().getName() + " already exsit.");
              }
              // define field
              mc.appendLineCode0(CodedConstant.getMappedTypeDefined(field.getOrder(), field.getFieldType(),
                      getAccessByField("t", field.getField(), cls), isList));
              // compute size
              StringBuilder code = new StringBuilder();
              code.append("if (!CodedConstant.isNull(").append(getAccessByField("t", field.getField(), cls)).append("))")
                      .append("{");
              mc.appendLineCode0(code.toString());
  
              code.setLength(0);
              code.append("size += ");
              code.append(CodedConstant.getMappedTypeSize(field, field.getOrder(), field.getFieldType(), isList, debug,
                      outputPath));
              code.append("}");
              mc.appendLineCode0(code.toString());
  
              if (field.isRequired()) {
                  mc.appendLineCode0(CodedConstant.getRequiredCheck(field.getOrder(), field.getField()));
              }
          }
  
          mc.appendLineCode1("return size");
  
          return mc;
      }