What is right method to pass led info from processing to arduino

you will in broadcast() in processing I send as;

byte out[] = new byte[4];
  out[0] = byte(r1);
  out[1] = byte(g1);
  out[2] = byte(b1);
  //send carriage return character 
  out[3] = byte('\r');

 arduinoPort.write(out);
  arduinoPort.bufferUntil('\n');