Did you have a look at QByteArray API prior to asking this question? Have you seen any methods that at least remotely looked like they were doing what you want? Which methods were they?