Check a can message

if(message.id == 0x181 and message.data[1] == 0x23)  //Test for PID 182 with data 23 in the 1th byte
             {

how can I make it check the complete message? the message is:
181 data: 00 23 00 01

  if(message.id == 0x181 and 
     message.data[0] == 0x00 and
     message.data[1] == 0x23 and
     message.data[2] == 0x00 and
     message.data[3] == 0x01) 
             {

thanks that was it!