PreprocessedContents convertFromByteArray(const QByteArray& array) { PreprocessedContents to; to.resize(array.size()); const char* data = array.constData(); const char* dataEnd = data + array.size(); unsigned int* target = to.data(); while(data < dataEnd) { *target = indexFromCharacter(*data); ++data; ++target; } return to; }