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); }
public CodeExpression GetWriterExpression(CodeExpression writer, CodeExpression obj) { return(CodeGen.CallMethod(writer, "Write", CodeGen.CreateByteArray(_bytes))); }