Arduino Serial.read question

In other words, you check if there is/are one or more characters available and next you read 10 regardless. The -1 indicates that there was no characcter available at the time of reading.

One solution:

if(Serial.available() >=10)
{
  // read 10 bytes
  ...
  ...
}

You can get some other ideas from Serial Input Basics - updated