there is a wide range:
from read byte
if ( myPort.available() > 0) { // If data is available,
val = myPort.read(); // read it and store it in val
}
to handle full lines
void serialEvent(Serial myPort) { // if want to see what the arduino is answering:
String arduinoline = myPort.readStringUntil(10);
if ( arduinoline != null ) print(arduinoline);
}
https://processing.org/reference/libraries/serial/Serial_readStringUntil_.html
https://processing.org/reference/libraries/serial/serialEvent_.html