Hello!

I am trying to dissect a program and got stuck with one function:

Qt Code:
  1. void SerialPortHandler::sendTrackPause()
  2. {
  3. // qDebug() << "sendTrackPause";
  4. QByteArray byteArr;
  5. QDataStream out(&byteArr, QIODevice::WriteOnly);
  6. out << ActionType::Track << TrackType::Pause << '\n';
  7. serial->write(byteArr);
  8. }
To copy to clipboard, switch view to plain text mode 

serial is an object of QSerialPort.
This function clearly pauses a player.

But what's going on under the hood?
For what sake do we need QByteArray and QDataStream?