Yeah, what is odd is that QByteArray.size() returns an int.  One wonders if for any reason it would return a negative number.  The docs do not say.