Did you check QByteArray doc? http://doc.qt.io/qt-4.8/qbytearray.html#operator-5b-5d