Added toTruncatedArray method into QBuffer, moved to getLength instead of getMaxLength

Fixed the build