Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 4930

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qbytearray.cpp -->
  <title>Qt 4.8: QByteArray Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QByteArray</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#notes-on-locale">Notes on Locale</a></li>
<li class="level3"><a href="#number-string-conversions">Number-String Conversions</a></li>
<li class="level3"><a href="#8-bit-character-comparisons">8-bit Character Comparisons</a></li>
</ul>
</div>
<h1 class="title">QByteArray Class Reference</h1>
<!-- $$$QByteArray-brief -->
<p>The QByteArray class provides an array of bytes. <a href="#details">More...</a></p>
<!-- @@@QByteArray -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QByteArray&gt;</span></pre><p><b>Inherited by: </b><a href="q3cstring.html" class="compat">Q3CString</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qbytearray-members.html">List of all members, including inherited members</a></li>
<li><a href="qbytearray-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#QByteArray">QByteArray</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#QByteArray-2">QByteArray</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#QByteArray-3">QByteArray</a></b> ( const char * <i>data</i>, int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#QByteArray-4">QByteArray</a></b> ( int <i>size</i>, char <i>ch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#QByteArray-6">QByteArray</a></b> ( const QByteArray &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#dtor.QByteArray">~QByteArray</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#append">append</a></b> ( const QByteArray &amp; <i>ba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#append-2">append</a></b> ( const QString &amp; <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#append-3">append</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#append-4">append</a></b> ( const char * <i>str</i>, int <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#append-5">append</a></b> ( char <i>ch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#at">at</a></b> ( int <i>i</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#capacity">capacity</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#chop">chop</a></b> ( int <i>n</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const char * </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#constData">constData</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#contains">contains</a></b> ( const QByteArray &amp; <i>ba</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#contains-2">contains</a></b> ( const char * <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#contains-3">contains</a></b> ( char <i>ch</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#count">count</a></b> ( const QByteArray &amp; <i>ba</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#count-2">count</a></b> ( const char * <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#count-3">count</a></b> ( char <i>ch</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#count-4">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char * </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#data">data</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const char * </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#data-2">data</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#endsWith">endsWith</a></b> ( const QByteArray &amp; <i>ba</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#endsWith-2">endsWith</a></b> ( const char * <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#endsWith-3">endsWith</a></b> ( char <i>ch</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#fill">fill</a></b> ( char <i>ch</i>, int <i>size</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#indexOf">indexOf</a></b> ( const QByteArray &amp; <i>ba</i>, int <i>from</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#indexOf-2">indexOf</a></b> ( const QString &amp; <i>str</i>, int <i>from</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#indexOf-3">indexOf</a></b> ( const char * <i>str</i>, int <i>from</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#indexOf-4">indexOf</a></b> ( char <i>ch</i>, int <i>from</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#insert">insert</a></b> ( int <i>i</i>, const QByteArray &amp; <i>ba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#insert-2">insert</a></b> ( int <i>i</i>, const QString &amp; <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#insert-3">insert</a></b> ( int <i>i</i>, const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#insert-4">insert</a></b> ( int <i>i</i>, const char * <i>str</i>, int <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#insert-5">insert</a></b> ( int <i>i</i>, char <i>ch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#lastIndexOf">lastIndexOf</a></b> ( const QByteArray &amp; <i>ba</i>, int <i>from</i> = -1 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#lastIndexOf-2">lastIndexOf</a></b> ( const QString &amp; <i>str</i>, int <i>from</i> = -1 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#lastIndexOf-3">lastIndexOf</a></b> ( const char * <i>str</i>, int <i>from</i> = -1 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#lastIndexOf-4">lastIndexOf</a></b> ( char <i>ch</i>, int <i>from</i> = -1 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#left">left</a></b> ( int <i>len</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#leftJustified">leftJustified</a></b> ( int <i>width</i>, char <i>fill</i> = ' ', bool <i>truncate</i> = false ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#length">length</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#mid">mid</a></b> ( int <i>pos</i>, int <i>len</i> = -1 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#prepend">prepend</a></b> ( const QByteArray &amp; <i>ba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#prepend-2">prepend</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#prepend-3">prepend</a></b> ( const char * <i>str</i>, int <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#prepend-4">prepend</a></b> ( char <i>ch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#push_back">push_back</a></b> ( const QByteArray &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#push_back-2">push_back</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#push_back-3">push_back</a></b> ( char <i>ch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#push_front">push_front</a></b> ( const QByteArray &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#push_front-2">push_front</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#push_front-3">push_front</a></b> ( char <i>ch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#remove">remove</a></b> ( int <i>pos</i>, int <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#repeated">repeated</a></b> ( int <i>times</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace">replace</a></b> ( int <i>pos</i>, int <i>len</i>, const QByteArray &amp; <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-2">replace</a></b> ( int <i>pos</i>, int <i>len</i>, const char * <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-3">replace</a></b> ( int <i>pos</i>, int <i>len</i>, const char * <i>after</i>, int <i>alen</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-4">replace</a></b> ( const QByteArray &amp; <i>before</i>, const QByteArray &amp; <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-5">replace</a></b> ( const char * <i>before</i>, const QByteArray &amp; <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-6">replace</a></b> ( const char * <i>before</i>, int <i>bsize</i>, const char * <i>after</i>, int <i>asize</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-7">replace</a></b> ( const QByteArray &amp; <i>before</i>, const char * <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-8">replace</a></b> ( const QString &amp; <i>before</i>, const QByteArray &amp; <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-9">replace</a></b> ( const QString &amp; <i>before</i>, const char * <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-10">replace</a></b> ( const char * <i>before</i>, const char * <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-11">replace</a></b> ( char <i>before</i>, const QByteArray &amp; <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-12">replace</a></b> ( char <i>before</i>, const QString &amp; <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-13">replace</a></b> ( char <i>before</i>, const char * <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#replace-14">replace</a></b> ( char <i>before</i>, char <i>after</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#reserve">reserve</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#resize">resize</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#right">right</a></b> ( int <i>len</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#rightJustified">rightJustified</a></b> ( int <i>width</i>, char <i>fill</i> = ' ', bool <i>truncate</i> = false ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum">setNum</a></b> ( int <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum-2">setNum</a></b> ( uint <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum-3">setNum</a></b> ( short <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum-4">setNum</a></b> ( ushort <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum-5">setNum</a></b> ( qlonglong <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum-6">setNum</a></b> ( qulonglong <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum-7">setNum</a></b> ( double <i>n</i>, char <i>f</i> = 'g', int <i>prec</i> = 6 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setNum-8">setNum</a></b> ( float <i>n</i>, char <i>f</i> = 'g', int <i>prec</i> = 6 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#setRawData">setRawData</a></b> ( const char * <i>data</i>, uint <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#simplified">simplified</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QByteArray&gt; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#split">split</a></b> ( char <i>sep</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#squeeze">squeeze</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#startsWith">startsWith</a></b> ( const QByteArray &amp; <i>ba</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#startsWith-2">startsWith</a></b> ( const char * <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#startsWith-3">startsWith</a></b> ( char <i>ch</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#swap">swap</a></b> ( QByteArray &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toBase64">toBase64</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toDouble">toDouble</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> float </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toFloat">toFloat</a></b> ( bool * <i>ok</i> = 0 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toHex">toHex</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toInt">toInt</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> long </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toLong">toLong</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qlonglong </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toLongLong">toLongLong</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toLower">toLower</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toPercentEncoding">toPercentEncoding</a></b> ( const QByteArray &amp; <i>exclude</i> = QByteArray(), const QByteArray &amp; <i>include</i> = QByteArray(), char <i>percent</i> = '%' ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> short </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toShort">toShort</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toUInt">toUInt</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ulong </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toULong">toULong</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qulonglong </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toULongLong">toULongLong</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ushort </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toUShort">toUShort</a></b> ( bool * <i>ok</i> = 0, int <i>base</i> = 10 ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#toUpper">toUpper</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#trimmed">trimmed</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#truncate">truncate</a></b> ( int <i>pos</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-const-char--2a">operator const char *</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-const-void--2a">operator const void *</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-not-eq">operator!=</a></b> ( const QString &amp; <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-eq">operator+=</a></b> ( const QByteArray &amp; <i>ba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-eq-2">operator+=</a></b> ( const QString &amp; <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-eq-3">operator+=</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-eq-4">operator+=</a></b> ( char <i>ch</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt">operator&lt;</a></b> ( const QString &amp; <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-eq">operator&lt;=</a></b> ( const QString &amp; <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-eq">operator=</a></b> ( const QByteArray &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-eq-2">operator=</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-eq-eq">operator==</a></b> ( const QString &amp; <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt">operator&gt;</a></b> ( const QString &amp; <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-eq">operator&gt;=</a></b> ( const QString &amp; <i>str</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteRef </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-5b-5d">operator[]</a></b> ( int <i>i</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-5b-5d-2">operator[]</a></b> ( int <i>i</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteRef </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-5b-5d-3">operator[]</a></b> ( uint <i>i</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-5b-5d-4">operator[]</a></b> ( uint <i>i</i> ) const</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#fromBase64">fromBase64</a></b> ( const QByteArray &amp; <i>base64</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#fromHex">fromHex</a></b> ( const QByteArray &amp; <i>hexEncoded</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#fromPercentEncoding">fromPercentEncoding</a></b> ( const QByteArray &amp; <i>input</i>, char <i>percent</i> = '%' )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#fromRawData">fromRawData</a></b> ( const char * <i>data</i>, int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#number">number</a></b> ( int <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#number-2">number</a></b> ( uint <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#number-3">number</a></b> ( qlonglong <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#number-4">number</a></b> ( qulonglong <i>n</i>, int <i>base</i> = 10 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#number-5">number</a></b> ( double <i>n</i>, char <i>f</i> = 'g', int <i>prec</i> = 6 )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> quint16 </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qChecksum">qChecksum</a></b> ( const char * <i>data</i>, uint <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qCompress">qCompress</a></b> ( const QByteArray &amp; <i>data</i>, int <i>compressionLevel</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qCompress-2">qCompress</a></b> ( const uchar * <i>data</i>, int <i>nbytes</i>, int <i>compressionLevel</i> = -1 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qUncompress">qUncompress</a></b> ( const QByteArray &amp; <i>data</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qUncompress-2">qUncompress</a></b> ( const uchar * <i>data</i>, int <i>nbytes</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qsnprintf">qsnprintf</a></b> ( char * <i>str</i>, size_t <i>n</i>, const char * <i>fmt</i>, ... )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrcmp">qstrcmp</a></b> ( const char * <i>str1</i>, const char * <i>str2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char * </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrcpy">qstrcpy</a></b> ( char * <i>dst</i>, const char * <i>src</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char * </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrdup">qstrdup</a></b> ( const char * <i>src</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstricmp">qstricmp</a></b> ( const char * <i>str1</i>, const char * <i>str2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrlen">qstrlen</a></b> ( const char * <i>str</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrncmp">qstrncmp</a></b> ( const char * <i>str1</i>, const char * <i>str2</i>, uint <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> char * </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrncpy">qstrncpy</a></b> ( char * <i>dst</i>, const char * <i>src</i>, uint <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrnicmp">qstrnicmp</a></b> ( const char * <i>str1</i>, const char * <i>str2</i>, uint <i>len</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qstrnlen">qstrnlen</a></b> ( const char * <i>str</i>, uint <i>maxlen</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#qvsnprintf">qvsnprintf</a></b> ( char * <i>str</i>, size_t <i>n</i>, const char * <i>fmt</i>, va_list <i>ap</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-not-eq-67">operator!=</a></b> ( const QByteArray &amp; <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-not-eq-68">operator!=</a></b> ( const QByteArray &amp; <i>a1</i>, const char * <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-not-eq-69">operator!=</a></b> ( const char * <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-40">operator+</a></b> ( const QByteArray &amp; <i>a1</i>, const char * <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-41">operator+</a></b> ( const QByteArray &amp; <i>a1</i>, char <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-42">operator+</a></b> ( const char * <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-43">operator+</a></b> ( char <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-2b-14">operator+</a></b> ( const QByteArray &amp; <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-19">operator&lt;</a></b> ( const QByteArray &amp; <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-20">operator&lt;</a></b> ( const QByteArray &amp; <i>a1</i>, const char * <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-21">operator&lt;</a></b> ( const char * <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-lt-49">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>out</i>, const QByteArray &amp; <i>ba</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-eq-13">operator&lt;=</a></b> ( const QByteArray &amp; <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-eq-14">operator&lt;=</a></b> ( const QByteArray &amp; <i>a1</i>, const char * <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-lt-eq-15">operator&lt;=</a></b> ( const char * <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-eq-eq-95">operator==</a></b> ( const QByteArray &amp; <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-eq-eq-96">operator==</a></b> ( const QByteArray &amp; <i>a1</i>, const char * <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-eq-eq-97">operator==</a></b> ( const char * <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-13">operator&gt;</a></b> ( const QByteArray &amp; <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-14">operator&gt;</a></b> ( const QByteArray &amp; <i>a1</i>, const char * <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-15">operator&gt;</a></b> ( const char * <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-eq-13">operator&gt;=</a></b> ( const QByteArray &amp; <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-eq-14">operator&gt;=</a></b> ( const QByteArray &amp; <i>a1</i>, const char * <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-eq-15">operator&gt;=</a></b> ( const char * <i>a1</i>, const QByteArray &amp; <i>a2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#operator-gt-gt-31">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>in</i>, QByteArray &amp; <i>ba</i> )</td></tr>
</table>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbytearray.html#QT_NO_CAST_FROM_BYTEARRAY">QT_NO_CAST_FROM_BYTEARRAY</a></b></td></tr>
</table>
<a name="details"></a>
<!-- $$$QByteArray-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QByteArray class provides an array of bytes.</p>
<p>QByteArray can be used to store both raw bytes (including '\0's) and traditional 8-bit '\0'-terminated strings. Using QByteArray is much more convenient than using <tt>const char *</tt>. Behind the scenes, it always ensures that the data is followed by a '\0' terminator, and uses <a href="implicit-sharing.html">implicit sharing</a> (copy-on-write) to reduce memory usage and avoid needless copying of data.</p>
<p>In addition to QByteArray, Qt also provides the <a href="qstring.html">QString</a> class to store string data. For most purposes, <a href="qstring.html">QString</a> is the class you want to use. It stores 16-bit Unicode characters, making it easy to store non-ASCII/non-Latin-1 characters in your application. Furthermore, <a href="qstring.html">QString</a> is used throughout in the Qt API. The two main cases where QByteArray is appropriate are when you need to store raw binary data, and when memory conservation is critical (e.g&#x2e;, with Qt for Embedded Linux).</p>
<p>One way to initialize a QByteArray is simply to pass a <tt>const char *</tt> to its constructor. For example, the following code creates a byte array of size 5 containing the data &quot;Hello&quot;:</p>
<pre class="cpp"> <span class="type">QByteArray</span> ba(<span class="string">&quot;Hello&quot;</span>);</pre>
<p>Although the <a href="qbytearray.html#size">size</a>() is 5, the byte array also maintains an extra '\0' character at the end so that if a function is used that asks for a pointer to the underlying data (e.g&#x2e; a call to <a href="qbytearray.html#data">data</a>()), the data pointed to is guaranteed to be '\0'-terminated.</p>
<p>QByteArray makes a deep copy of the <tt>const char *</tt> data, so you can modify it later without experiencing side effects. (If for performance reasons you don't want to take a deep copy of the character data, use <a href="qbytearray.html#fromRawData">QByteArray::fromRawData</a>() instead.)</p>
<p>Another approach is to set the size of the array using <a href="qbytearray.html#resize">resize</a>() and to initialize the data byte per byte. QByteArray uses 0-based indexes, just like C++ arrays. To access the byte at a particular index position, you can use operator[](). On non-const byte arrays, operator[]() returns a reference to a byte that can be used on the left side of an assignment. For example:</p>
<pre class="cpp"> <span class="type">QByteArray</span> ba;
 ba<span class="operator">.</span>resize(<span class="number">5</span>);
 ba<span class="operator">[</span><span class="number">0</span><span class="operator">]</span> <span class="operator">=</span> <span class="number">0x3c</span>;
 ba<span class="operator">[</span><span class="number">1</span><span class="operator">]</span> <span class="operator">=</span> <span class="number">0xb8</span>;
 ba<span class="operator">[</span><span class="number">2</span><span class="operator">]</span> <span class="operator">=</span> <span class="number">0x64</span>;
 ba<span class="operator">[</span><span class="number">3</span><span class="operator">]</span> <span class="operator">=</span> <span class="number">0x18</span>;
 ba<span class="operator">[</span><span class="number">4</span><span class="operator">]</span> <span class="operator">=</span> <span class="number">0xca</span>;</pre>
<p>For read-only access, an alternative syntax is to use <a href="qbytearray.html#at">at</a>():</p>
<pre class="cpp"> <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator">&lt;</span> ba<span class="operator">.</span>size(); <span class="operator">+</span><span class="operator">+</span>i) {
     <span class="keyword">if</span> (ba<span class="operator">.</span>at(i) <span class="operator">&gt;</span><span class="operator">=</span> <span class="char">'a'</span> <span class="operator">&amp;</span><span class="operator">&amp;</span> ba<span class="operator">.</span>at(i) <span class="operator">&lt;</span><span class="operator">=</span> <span class="char">'f'</span>)
         cout <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Found character in range [a-f]&quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;
 }</pre>
<p><a href="qbytearray.html#at">at</a>() can be faster than operator[](), because it never causes a <a href="implicit-sharing.html#deep-copy">deep copy</a> to occur.</p>
<p>To extract many bytes at a time, use <a href="qbytearray.html#left">left</a>(), <a href="qbytearray.html#right">right</a>(), or <a href="qbytearray.html#mid">mid</a>().</p>
<p>A QByteArray can embed '\0' bytes. The <a href="qbytearray.html#size">size</a>() function always returns the size of the whole array, including embedded '\0' bytes. If you want to obtain the length of the data up to and excluding the first '\0' character, call <a href="qbytearray.html#qstrlen">qstrlen</a>() on the byte array.</p>
<p>After a call to <a href="qbytearray.html#resize">resize</a>(), newly allocated bytes have undefined values. To set all the bytes to a particular value, call <a href="qbytearray.html#fill">fill</a>().</p>
<p>To obtain a pointer to the actual character data, call <a href="qbytearray.html#data">data</a>() or <a href="qbytearray.html#constData">constData</a>(). These functions return a pointer to the beginning of the data. The pointer is guaranteed to remain valid until a non-const function is called on the QByteArray. It is also guaranteed that the data ends with a '\0' byte unless the QByteArray was created from a <a href="qbytearray.html#fromRawData">raw data</a>. This '\0' byte is automatically provided by QByteArray and is not counted in <a href="qbytearray.html#size">size</a>().</p>
<p>QByteArray provides the following basic functions for modifying the byte data: <a href="qbytearray.html#append">append</a>(), <a href="qbytearray.html#prepend">prepend</a>(), <a href="qbytearray.html#insert">insert</a>(), <a href="qbytearray.html#replace">replace</a>(), and <a href="qbytearray.html#remove">remove</a>(). For example:</p>
<pre class="cpp"> <span class="type">QByteArray</span> x(<span class="string">&quot;and&quot;</span>);
 x<span class="operator">.</span>prepend(<span class="string">&quot;rock &quot;</span>);         <span class="comment">// x == &quot;rock and&quot;</span>
 x<span class="operator">.</span>append(<span class="string">&quot; roll&quot;</span>);          <span class="comment">// x == &quot;rock and roll&quot;</span>
 x<span class="operator">.</span>replace(<span class="number">5</span><span class="operator">,</span> <span class="number">3</span><span class="operator">,</span> <span class="string">&quot;&amp;&quot;</span>);       <span class="comment">// x == &quot;rock &amp; roll&quot;</span></pre>
<p>The <a href="qbytearray.html#replace">replace</a>() and <a href="qbytearray.html#remove">remove</a>() functions' first two arguments are the position from which to start erasing and the number of bytes that should be erased.</p>
<p>When you <a href="qbytearray.html#append">append</a>() data to a non-empty array, the array will be reallocated and the new data copied to it. You can avoid this behavior by calling <a href="qbytearray.html#reserve">reserve</a>(), which preallocates a certain amount of memory. You can also call <a href="qbytearray.html#capacity">capacity</a>() to find out how much memory QByteArray actually allocated. Data appended to an empty array is not copied.</p>
<p>A frequent requirement is to remove whitespace characters from a byte array ('\n', '\t', ' ', etc.)&#x2e; If you want to remove whitespace from both ends of a QByteArray, use <a href="qbytearray.html#trimmed">trimmed</a>(). If you want to remove whitespace from both ends and replace multiple consecutive whitespaces with a single space character within the byte array, use <a href="qbytearray.html#simplified">simplified</a>().</p>
<p>If you want to find all occurrences of a particular character or substring in a QByteArray, use <a href="qbytearray.html#indexOf">indexOf</a>() or <a href="qbytearray.html#lastIndexOf">lastIndexOf</a>(). The former searches forward starting from a given index position, the latter searches backward. Both return the index position of the character or substring if they find it; otherwise, they return -1. For example, here's a typical loop that finds all occurrences of a particular substring:</p>
<pre class="cpp"> <span class="type">QByteArray</span> ba(<span class="string">&quot;We must be &lt;b&gt;bold&lt;/b&gt;, very &lt;b&gt;bold&lt;/b&gt;&quot;</span>);
 <span class="type">int</span> j <span class="operator">=</span> <span class="number">0</span>;
 <span class="keyword">while</span> ((j <span class="operator">=</span> ba<span class="operator">.</span>indexOf(<span class="string">&quot;&lt;b&gt;&quot;</span><span class="operator">,</span> j)) <span class="operator">!</span><span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>) {
     cout <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;Found &lt;b&gt; tag at index position &quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> j <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;
     <span class="operator">+</span><span class="operator">+</span>j;
 }</pre>
<p>If you simply want to check whether a QByteArray contains a particular character or substring, use <a href="qbytearray.html#contains">contains</a>(). If you want to find out how many times a particular character or substring occurs in the byte array, use <a href="qbytearray.html#count">count</a>(). If you want to replace all occurrences of a particular value with another, use one of the two-parameter <a href="qbytearray.html#replace">replace</a>() overloads.</p>
<p>QByteArrays can be compared using overloaded operators such as operator&lt;(), operator&lt;=(), operator==(), operator&gt;=(), and so on. The comparison is based exclusively on the numeric values of the characters and is very fast, but is not what a human would expect. <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() is a better choice for sorting user-interface strings.</p>
<p>For historical reasons, QByteArray distinguishes between a null byte array and an empty byte array. A <i>null</i> byte array is a byte array that is initialized using QByteArray's default constructor or by passing (const char *)0 to the constructor. An <i>empty</i> byte array is any byte array with size 0. A null byte array is always empty, but an empty byte array isn't necessarily null:</p>
<pre class="cpp"> <span class="type">QByteArray</span>()<span class="operator">.</span>isNull();          <span class="comment">// returns true</span>
 <span class="type">QByteArray</span>()<span class="operator">.</span>isEmpty();         <span class="comment">// returns true</span>

 <span class="type">QByteArray</span>(<span class="string">&quot;&quot;</span>)<span class="operator">.</span>isNull();        <span class="comment">// returns false</span>
 <span class="type">QByteArray</span>(<span class="string">&quot;&quot;</span>)<span class="operator">.</span>isEmpty();       <span class="comment">// returns true</span>

 <span class="type">QByteArray</span>(<span class="string">&quot;abc&quot;</span>)<span class="operator">.</span>isNull();     <span class="comment">// returns false</span>
 <span class="type">QByteArray</span>(<span class="string">&quot;abc&quot;</span>)<span class="operator">.</span>isEmpty();    <span class="comment">// returns false</span></pre>
<p>All functions except <a href="qbytearray.html#isNull">isNull</a>() treat null byte arrays the same as empty byte arrays. For example, <a href="qbytearray.html#data">data</a>() returns a pointer to a '\0' character for a null byte array (<i>not</i> a null pointer), and <a href="qbytearray.html#QByteArray">QByteArray</a>() compares equal to QByteArray(&quot;&quot;). We recommend that you always use <a href="qbytearray.html#isEmpty">isEmpty</a>() and avoid <a href="qbytearray.html#isNull">isNull</a>().</p>
<a name="notes-on-locale"></a>
<h3>Notes on Locale</h3>
<a name="number-string-conversions"></a>
<h4>Number-String Conversions</h4>
<p>Functions that perform conversions between numeric data types and strings are performed in the C locale, irrespective of the user's locale settings. Use <a href="qstring.html">QString</a> to perform locale-aware conversions between numbers and strings.</p>
<a name="8-bit-character-comparisons"></a>
<h4>8-bit Character Comparisons</h4>
<p>In QByteArray, the notion of uppercase and lowercase and of which character is greater than or less than another character is locale dependent. This affects functions that support a case insensitive option or that compare or lowercase or uppercase their arguments. Case insensitive operations and comparisons will be accurate if both strings contain only ASCII characters. (If <tt>$LC_CTYPE</tt> is set, most Unix systems do &quot;the right thing&quot;.) Functions that this affects include <a href="qbytearray.html#contains">contains</a>(), <a href="qbytearray.html#indexOf">indexOf</a>(), <a href="qbytearray.html#lastIndexOf">lastIndexOf</a>(), operator&lt;(), operator&lt;=(), operator&gt;(), operator&gt;=(), <a href="qbytearray.html#toLower">toLower</a>() and <a href="qbytearray.html#toUpper">toUpper</a>().</p>
<p>This issue does not apply to QStrings since they represent characters using Unicode.</p>
</div>
<p><b>See also </b><a href="qstring.html">QString</a> and <a href="qbitarray.html">QBitArray</a>.</p>
<!-- @@@QByteArray -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QByteArray[overload1]$$$QByteArray -->
<h3 class="fn"><a name="QByteArray"></a>QByteArray::<span class="name">QByteArray</span> ()</h3>
<p>Constructs an empty byte array.</p>
<p><b>See also </b><a href="qbytearray.html#isEmpty">isEmpty</a>().</p>
<!-- @@@QByteArray -->
<!-- $$$QByteArray$$$QByteArrayconstchar* -->
<h3 class="fn"><a name="QByteArray-2"></a>QByteArray::<span class="name">QByteArray</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>Constructs a byte array initialized with the string <i>str</i>.</p>
<p><a href="qbytearray.html">QByteArray</a> makes a deep copy of the string data.</p>
<!-- @@@QByteArray -->
<!-- $$$QByteArray$$$QByteArrayconstchar*int -->
<h3 class="fn"><a name="QByteArray-3"></a>QByteArray::<span class="name">QByteArray</span> ( const <span class="type">char</span> * <i>data</i>, <span class="type">int</span> <i>size</i> )</h3>
<p>Constructs a byte array containing the first <i>size</i> bytes of array <i>data</i>.</p>
<p>If <i>data</i> is 0, a null byte array is constructed.</p>
<p><a href="qbytearray.html">QByteArray</a> makes a deep copy of the string data.</p>
<p><b>See also </b><a href="qbytearray.html#fromRawData">fromRawData</a>().</p>
<!-- @@@QByteArray -->
<!-- $$$QByteArray$$$QByteArrayintchar -->
<h3 class="fn"><a name="QByteArray-4"></a>QByteArray::<span class="name">QByteArray</span> ( <span class="type">int</span> <i>size</i>, <span class="type">char</span> <i>ch</i> )</h3>
<p>Constructs a byte array of size <i>size</i> with every byte set to character <i>ch</i>.</p>
<p><b>See also </b><a href="qbytearray.html#fill">fill</a>().</p>
<!-- @@@QByteArray -->
<!-- $$$QByteArray$$$QByteArrayconstQByteArray& -->
<h3 class="fn"><a name="QByteArray-6"></a>QByteArray::<span class="name">QByteArray</span> ( const <span class="type">QByteArray</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<p>This operation takes <a href="containers.html#constant-time">constant time</a>, because <a href="qbytearray.html">QByteArray</a> is <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a>. This makes returning a <a href="qbytearray.html">QByteArray</a> from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), taking <a href="containers.html#linear-time">linear time</a>.</p>
<p><b>See also </b><a href="qbytearray.html#operator-eq">operator=</a>().</p>
<!-- @@@QByteArray -->
<!-- $$$~QByteArray[overload1]$$$~QByteArray -->
<h3 class="fn"><a name="dtor.QByteArray"></a>QByteArray::<span class="name">~QByteArray</span> ()</h3>
<p>Destroys the byte array.</p>
<!-- @@@~QByteArray -->
<!-- $$$append[overload1]$$$appendconstQByteArray& -->
<h3 class="fn"><a name="append"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">append</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i> )</h3>
<p>Appends the byte array <i>ba</i> onto the end of this byte array.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;free&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y(<span class="string">&quot;dom&quot;</span>);
 x<span class="operator">.</span>append(y);
 <span class="comment">// x == &quot;freedom&quot;</span></pre>
<p>This is the same as insert(<a href="qbytearray.html#size">size</a>(), <i>ba</i>).</p>
<p>Note: <a href="qbytearray.html">QByteArray</a> is an <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a> class. Consequently, if <i>this</i> is an empty <a href="qbytearray.html">QByteArray</a>, then <i>this</i> will just share the data held in <i>ba</i>. In this case, no copying of data is done, taking <a href="containers.html#constant-time">constant time</a>. If a shared instance is modified, it will be copied (copy-on-write), taking <a href="containers.html#linear-time">linear time</a>.</p>
<p>If <i>this</i> is not an empty <a href="qbytearray.html">QByteArray</a>, a deep copy of the data is performed, taking <a href="containers.html#linear-time">linear time</a>.</p>
<p>This operation typically does not suffer from allocation overhead, because <a href="qbytearray.html">QByteArray</a> preallocates extra space at the end of the data so that it may grow without reallocating for each append operation.</p>
<p><b>See also </b><a href="qbytearray.html#operator-2b-eq">operator+=</a>(), <a href="qbytearray.html#prepend">prepend</a>(), and <a href="qbytearray.html#insert">insert</a>().</p>
<!-- @@@append -->
<!-- $$$append$$$appendconstQString& -->
<h3 class="fn"><a name="append-2"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">append</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the string <i>str</i> to this byte array. The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>If the <a href="qstring.html">QString</a> contains non-ASCII Unicode characters, using this function can lead to loss of information. You can disable this function by defining <tt>QT_NO_CAST_TO_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#toAscii">QString::toAscii</a>() (or <a href="qstring.html#toLatin1">QString::toLatin1</a>() or <a href="qstring.html#toUtf8">QString::toUtf8</a>() or <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>()) explicitly if you want to convert the data to <tt>const char *</tt>.</p>
<!-- @@@append -->
<!-- $$$append$$$appendconstchar* -->
<h3 class="fn"><a name="append-3"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">append</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the string <i>str</i> to this byte array.</p>
<!-- @@@append -->
<!-- $$$append$$$appendconstchar*int -->
<h3 class="fn"><a name="append-4"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">append</span> ( const <span class="type">char</span> * <i>str</i>, <span class="type">int</span> <i>len</i> )</h3>
<p>This function overloads <a href="qbytearray.html#append">append</a>().</p>
<p>Appends the first <i>len</i> characters of the string <i>str</i> to this byte array and returns a reference to this byte array.</p>
<p>If <i>len</i> is negative, the length of the string will be determined automatically using <a href="qbytearray.html#qstrlen">qstrlen</a>(). If <i>len</i> is zero or <i>str</i> is null, nothing is appended to the byte array. Ensure that <i>len</i> is <i>not</i> longer than <i>str</i>.</p>
<!-- @@@append -->
<!-- $$$append$$$appendchar -->
<h3 class="fn"><a name="append-5"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">append</span> ( <span class="type">char</span> <i>ch</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the character <i>ch</i> to this byte array.</p>
<!-- @@@append -->
<!-- $$$at[overload1]$$$atint -->
<h3 class="fn"><a name="at"></a><span class="type">char</span> QByteArray::<span class="name">at</span> ( <span class="type">int</span> <i>i</i> ) const</h3>
<p>Returns the character at index position <i>i</i> in the byte array.</p>
<p><i>i</i> must be a valid index position in the byte array (i.e&#x2e;, 0 &lt;= <i>i</i> &lt; <a href="qbytearray.html#size">size</a>()).</p>
<p><b>See also </b><a href="qbytearray.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@at -->
<!-- $$$capacity[overload1]$$$capacity -->
<h3 class="fn"><a name="capacity"></a><span class="type">int</span> QByteArray::<span class="name">capacity</span> () const</h3>
<p>Returns the maximum number of bytes that can be stored in the byte array without forcing a reallocation.</p>
<p>The sole purpose of this function is to provide a means of fine tuning <a href="qbytearray.html">QByteArray</a>'s memory usage. In general, you will rarely ever need to call this function. If you want to know how many bytes are in the byte array, call <a href="qbytearray.html#size">size</a>().</p>
<p><b>See also </b><a href="qbytearray.html#reserve">reserve</a>() and <a href="qbytearray.html#squeeze">squeeze</a>().</p>
<!-- @@@capacity -->
<!-- $$$chop[overload1]$$$chopint -->
<h3 class="fn"><a name="chop"></a><span class="type">void</span> QByteArray::<span class="name">chop</span> ( <span class="type">int</span> <i>n</i> )</h3>
<p>Removes <i>n</i> bytes from the end of the byte array.</p>
<p>If <i>n</i> is greater than <a href="qbytearray.html#size">size</a>(), the result is an empty byte array.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;STARTTLS\r\n&quot;</span>);
 ba<span class="operator">.</span>chop(<span class="number">2</span>);                 <span class="comment">// ba == &quot;STARTTLS&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#truncate">truncate</a>(), <a href="qbytearray.html#resize">resize</a>(), and <a href="qbytearray.html#left">left</a>().</p>
<!-- @@@chop -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QByteArray::<span class="name">clear</span> ()</h3>
<p>Clears the contents of the byte array and makes it empty.</p>
<p><b>See also </b><a href="qbytearray.html#resize">resize</a>() and <a href="qbytearray.html#isEmpty">isEmpty</a>().</p>
<!-- @@@clear -->
<!-- $$$constData[overload1]$$$constData -->
<h3 class="fn"><a name="constData"></a>const <span class="type">char</span> * QByteArray::<span class="name">constData</span> () const</h3>
<p>Returns a pointer to the data stored in the byte array. The pointer can be used to access the bytes that compose the array. The data is '\0'-terminated unless the <a href="qbytearray.html">QByteArray</a> object was created from raw data. The pointer remains valid as long as the byte array isn't reallocated or destroyed.</p>
<p>This function is mostly useful to pass a byte array to a function that accepts a <tt>const char *</tt>.</p>
<p>Note: A <a href="qbytearray.html">QByteArray</a> can store any byte values including '\0's, but most functions that take <tt>char *</tt> arguments assume that the data ends at the first '\0' they encounter.</p>
<p><b>See also </b><a href="qbytearray.html#data">data</a>(), <a href="qbytearray.html#operator-5b-5d">operator[]</a>(), and <a href="qbytearray.html#fromRawData">fromRawData</a>().</p>
<!-- @@@constData -->
<!-- $$$contains[overload1]$$$containsconstQByteArray& -->
<h3 class="fn"><a name="contains"></a><span class="type">bool</span> QByteArray::<span class="name">contains</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i> ) const</h3>
<p>Returns true if the byte array contains an occurrence of the byte array <i>ba</i>; otherwise returns false.</p>
<p><b>See also </b><a href="qbytearray.html#indexOf">indexOf</a>() and <a href="qbytearray.html#count">count</a>().</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsconstchar* -->
<h3 class="fn"><a name="contains-2"></a><span class="type">bool</span> QByteArray::<span class="name">contains</span> ( const <span class="type">char</span> * <i>str</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if the byte array contains the string <i>str</i>; otherwise returns false.</p>
<!-- @@@contains -->
<!-- $$$contains$$$containschar -->
<h3 class="fn"><a name="contains-3"></a><span class="type">bool</span> QByteArray::<span class="name">contains</span> ( <span class="type">char</span> <i>ch</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if the byte array contains the character <i>ch</i>; otherwise returns false.</p>
<!-- @@@contains -->
<!-- $$$count[overload1]$$$countconstQByteArray& -->
<h3 class="fn"><a name="count"></a><span class="type">int</span> QByteArray::<span class="name">count</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i> ) const</h3>
<p>Returns the number of (potentially overlapping) occurrences of byte array <i>ba</i> in this byte array.</p>
<p><b>See also </b><a href="qbytearray.html#contains">contains</a>() and <a href="qbytearray.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$countconstchar* -->
<h3 class="fn"><a name="count-2"></a><span class="type">int</span> QByteArray::<span class="name">count</span> ( const <span class="type">char</span> * <i>str</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the number of (potentially overlapping) occurrences of string <i>str</i> in the byte array.</p>
<!-- @@@count -->
<!-- $$$count$$$countchar -->
<h3 class="fn"><a name="count-3"></a><span class="type">int</span> QByteArray::<span class="name">count</span> ( <span class="type">char</span> <i>ch</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the number of occurrences of character <i>ch</i> in the byte array.</p>
<p><b>See also </b><a href="qbytearray.html#contains">contains</a>() and <a href="qbytearray.html#indexOf">indexOf</a>().</p>
<!-- @@@count -->
<!-- $$$count$$$count -->
<h3 class="fn"><a name="count-4"></a><span class="type">int</span> QByteArray::<span class="name">count</span> () const</h3>
<p>This is an overloaded function.</p>
<p>Same as <a href="qbytearray.html#size">size</a>().</p>
<!-- @@@count -->
<!-- $$$data[overload1]$$$data -->
<h3 class="fn"><a name="data"></a><span class="type">char</span> * QByteArray::<span class="name">data</span> ()</h3>
<p>Returns a pointer to the data stored in the byte array. The pointer can be used to access and modify the bytes that compose the array. The data is '\0'-terminated, i.e&#x2e; the number of bytes in the returned character string is <a href="qbytearray.html#size">size</a>() + 1 for the '\0' terminator.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;Hello world&quot;</span>);
 <span class="type">char</span> <span class="operator">*</span>data <span class="operator">=</span> ba<span class="operator">.</span>data();
 <span class="keyword">while</span> (<span class="operator">*</span>data) {
     cout <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;[&quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="operator">*</span>data <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="string">&quot;]&quot;</span> <span class="operator">&lt;</span><span class="operator">&lt;</span> endl;
     <span class="operator">+</span><span class="operator">+</span>data;
 }</pre>
<p>The pointer remains valid as long as the byte array isn't reallocated or destroyed. For read-only access, <a href="qbytearray.html#constData">constData</a>() is faster because it never causes a <a href="implicit-sharing.html#deep-copy">deep copy</a> to occur.</p>
<p>This function is mostly useful to pass a byte array to a function that accepts a <tt>const char *</tt>.</p>
<p>The following example makes a copy of the char* returned by data(), but it will corrupt the heap and cause a crash because it does not allocate a byte for the '\0' at the end:</p>
<pre class="cpp"> <span class="type"><a href="qstring.html">QString</a></span> tmp <span class="operator">=</span> <span class="string">&quot;test&quot;</span>;
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> text <span class="operator">=</span> tmp<span class="operator">.</span>toLocal8Bit();
 <span class="type">char</span> <span class="operator">*</span>data <span class="operator">=</span> <span class="keyword">new</span> <span class="type">char</span><span class="operator">[</span>text<span class="operator">.</span>size()<span class="operator">]</span>
 strcpy(data<span class="operator">,</span> text<span class="operator">.</span>data());
 <span class="keyword">delete</span> <span class="operator">[</span><span class="operator">]</span> data;</pre>
<p>This one allocates the correct amount of space:</p>
<pre class="cpp"> <span class="type"><a href="qstring.html">QString</a></span> tmp <span class="operator">=</span> <span class="string">&quot;test&quot;</span>;
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> text <span class="operator">=</span> tmp<span class="operator">.</span>toLocal8Bit();
 <span class="type">char</span> <span class="operator">*</span>data <span class="operator">=</span> <span class="keyword">new</span> <span class="type">char</span><span class="operator">[</span>text<span class="operator">.</span>size() <span class="operator">+</span> <span class="number">1</span><span class="operator">]</span>
 strcpy(data<span class="operator">,</span> text<span class="operator">.</span>data());
 <span class="keyword">delete</span> <span class="operator">[</span><span class="operator">]</span> data;</pre>
<p>Note: A <a href="qbytearray.html">QByteArray</a> can store any byte values including '\0's, but most functions that take <tt>char *</tt> arguments assume that the data ends at the first '\0' they encounter.</p>
<p><b>See also </b><a href="qbytearray.html#constData">constData</a>() and <a href="qbytearray.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@data -->
<!-- $$$data$$$data -->
<h3 class="fn"><a name="data-2"></a>const <span class="type">char</span> * QByteArray::<span class="name">data</span> () const</h3>
<p>This is an overloaded function.</p>
<!-- @@@data -->
<!-- $$$endsWith[overload1]$$$endsWithconstQByteArray& -->
<h3 class="fn"><a name="endsWith"></a><span class="type">bool</span> QByteArray::<span class="name">endsWith</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i> ) const</h3>
<p>Returns true if this byte array ends with byte array <i>ba</i>; otherwise returns false.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> url(<span class="string">&quot;http://qt.nokia.com/index.html&quot;</span>);
 <span class="keyword">if</span> (url<span class="operator">.</span>endsWith(<span class="string">&quot;.html&quot;</span>))
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span></pre>
<p><b>See also </b><a href="qbytearray.html#startsWith">startsWith</a>() and <a href="qbytearray.html#right">right</a>().</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithconstchar* -->
<h3 class="fn"><a name="endsWith-2"></a><span class="type">bool</span> QByteArray::<span class="name">endsWith</span> ( const <span class="type">char</span> * <i>str</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if this byte array ends with string <i>str</i>; otherwise returns false.</p>
<!-- @@@endsWith -->
<!-- $$$endsWith$$$endsWithchar -->
<h3 class="fn"><a name="endsWith-3"></a><span class="type">bool</span> QByteArray::<span class="name">endsWith</span> ( <span class="type">char</span> <i>ch</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if this byte array ends with character <i>ch</i>; otherwise returns false.</p>
<!-- @@@endsWith -->
<!-- $$$fill[overload1]$$$fillcharint -->
<h3 class="fn"><a name="fill"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">fill</span> ( <span class="type">char</span> <i>ch</i>, <span class="type">int</span> <i>size</i> = -1 )</h3>
<p>Sets every byte in the byte array to character <i>ch</i>. If <i>size</i> is different from -1 (the default), the byte array is resized to size <i>size</i> beforehand.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;Istambul&quot;</span>);
 ba<span class="operator">.</span>fill(<span class="char">'o'</span>);
 <span class="comment">// ba == &quot;oooooooo&quot;</span>

 ba<span class="operator">.</span>fill(<span class="char">'X'</span><span class="operator">,</span> <span class="number">2</span>);
 <span class="comment">// ba == &quot;XX&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#resize">resize</a>().</p>
<!-- @@@fill -->
<!-- $$$fromBase64[overload1]$$$fromBase64constQByteArray& -->
<h3 class="fn"><a name="fromBase64"></a><span class="type">QByteArray</span> QByteArray::<span class="name">fromBase64</span> ( const <span class="type">QByteArray</span> &amp; <i>base64</i> )<tt> [static]</tt></h3>
<p>Returns a decoded copy of the Base64 array <i>base64</i>. Input is not checked for validity; invalid characters in the input are skipped, enabling the decoding process to continue with subsequent characters.</p>
<p>For example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> text <span class="operator">=</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>fromBase64(<span class="string">&quot;UXQgaXMgZ3JlYXQh&quot;</span>);
 text<span class="operator">.</span>data();            <span class="comment">// returns &quot;Qt is great!&quot;</span></pre>
<p>The algorithm used to decode Base64-encoded data is defined in <a href="http://www.rfc-editor.org/rfc/rfc2045.txt">RFC 2045</a>.</p>
<p><b>See also </b><a href="qbytearray.html#toBase64">toBase64</a>().</p>
<!-- @@@fromBase64 -->
<!-- $$$fromHex[overload1]$$$fromHexconstQByteArray& -->
<h3 class="fn"><a name="fromHex"></a><span class="type">QByteArray</span> QByteArray::<span class="name">fromHex</span> ( const <span class="type">QByteArray</span> &amp; <i>hexEncoded</i> )<tt> [static]</tt></h3>
<p>Returns a decoded copy of the hex encoded array <i>hexEncoded</i>. Input is not checked for validity; invalid characters in the input are skipped, enabling the decoding process to continue with subsequent characters.</p>
<p>For example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> text <span class="operator">=</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>fromHex(<span class="string">&quot;517420697320677265617421&quot;</span>);
 text<span class="operator">.</span>data();            <span class="comment">// returns &quot;Qt is great!&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#toHex">toHex</a>().</p>
<!-- @@@fromHex -->
<!-- $$$fromPercentEncoding[overload1]$$$fromPercentEncodingconstQByteArray&char -->
<h3 class="fn"><a name="fromPercentEncoding"></a><span class="type">QByteArray</span> QByteArray::<span class="name">fromPercentEncoding</span> ( const <span class="type">QByteArray</span> &amp; <i>input</i>, <span class="type">char</span> <i>percent</i> = '%' )<tt> [static]</tt></h3>
<p>Returns a decoded copy of the URI/URL-style percent-encoded <i>input</i>. The <i>percent</i> parameter allows you to replace the '%' character for another (for instance, '<a href="index.html">_</a>' or '=').</p>
<p>For example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> text <span class="operator">=</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>fromPercentEncoding(<span class="string">&quot;Qt%20is%20great%33&quot;</span>);
 text<span class="operator">.</span><a href="qbytearray.html#data">data</a>();            <span class="comment">// returns &quot;Qt is great!&quot;</span></pre>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qbytearray.html#toPercentEncoding">toPercentEncoding</a>() and <a href="qurl.html#fromPercentEncoding">QUrl::fromPercentEncoding</a>().</p>
<!-- @@@fromPercentEncoding -->
<!-- $$$fromRawData[overload1]$$$fromRawDataconstchar*int -->
<h3 class="fn"><a name="fromRawData"></a><span class="type">QByteArray</span> QByteArray::<span class="name">fromRawData</span> ( const <span class="type">char</span> * <i>data</i>, <span class="type">int</span> <i>size</i> )<tt> [static]</tt></h3>
<p>Constructs a <a href="qbytearray.html">QByteArray</a> that uses the first <i>size</i> bytes of the <i>data</i> array. The bytes are <i>not</i> copied. The <a href="qbytearray.html">QByteArray</a> will contain the <i>data</i> pointer. The caller guarantees that <i>data</i> will not be deleted or modified as long as this <a href="qbytearray.html">QByteArray</a> and any copies of it exist that have not been modified. In other words, because <a href="qbytearray.html">QByteArray</a> is an <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a> class and the instance returned by this function contains the <i>data</i> pointer, the caller must not delete <i>data</i> or modify it directly as long as the returned <a href="qbytearray.html">QByteArray</a> and any copies exist. However, <a href="qbytearray.html">QByteArray</a> does not take ownership of <i>data</i>, so the <a href="qbytearray.html">QByteArray</a> destructor will never delete the raw <i>data</i>, even when the last <a href="qbytearray.html">QByteArray</a> referring to <i>data</i> is destroyed.</p>
<p>A subsequent attempt to modify the contents of the returned <a href="qbytearray.html">QByteArray</a> or any copy made from it will cause it to create a deep copy of the <i>data</i> array before doing the modification. This ensures that the raw <i>data</i> array itself will never be modified by <a href="qbytearray.html">QByteArray</a>.</p>
<p>Here is an example of how to read data using a <a href="qdatastream.html">QDataStream</a> on raw data in memory without copying the raw data into a <a href="qbytearray.html">QByteArray</a>:</p>
<pre class="cpp">  <span class="keyword">static</span> <span class="keyword">const</span> <span class="type">char</span> mydata<span class="operator">[</span><span class="operator">]</span> <span class="operator">=</span> {
     <span class="number">0x00</span><span class="operator">,</span> <span class="number">0x00</span><span class="operator">,</span> <span class="number">0x03</span><span class="operator">,</span> <span class="number">0x84</span><span class="operator">,</span> <span class="number">0x78</span><span class="operator">,</span> <span class="number">0x9c</span><span class="operator">,</span> <span class="number">0x3b</span><span class="operator">,</span> <span class="number">0x76</span><span class="operator">,</span>
     <span class="number">0xec</span><span class="operator">,</span> <span class="number">0x18</span><span class="operator">,</span> <span class="number">0xc3</span><span class="operator">,</span> <span class="number">0x31</span><span class="operator">,</span> <span class="number">0x0a</span><span class="operator">,</span> <span class="number">0xf1</span><span class="operator">,</span> <span class="number">0xcc</span><span class="operator">,</span> <span class="number">0x99</span><span class="operator">,</span>
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="number">0x6d</span><span class="operator">,</span> <span class="number">0x5b</span>
 };

 <span class="type"><a href="qbytearray.html">QByteArray</a></span> data <span class="operator">=</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>fromRawData(mydata<span class="operator">,</span> <span class="keyword">sizeof</span>(mydata));
 <span class="type"><a href="qdatastream.html">QDataStream</a></span> in(<span class="operator">&amp;</span>data<span class="operator">,</span> <span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">::</span>ReadOnly);
 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span></pre>
<p><b>Warning:</b> A byte array created with fromRawData() is <i>not</i> null-terminated, unless the raw data contains a 0 character at position <i>size</i>. While that does not matter for <a href="qdatastream.html">QDataStream</a> or functions like <a href="qbytearray.html#indexOf">indexOf</a>(), passing the byte array to a function accepting a <tt>const char *</tt> expected to be '\0'-terminated will fail.</p>
<p><b>See also </b><a href="qbytearray.html#setRawData">setRawData</a>(), <a href="qbytearray.html#data">data</a>(), and <a href="qbytearray.html#constData">constData</a>().</p>
<!-- @@@fromRawData -->
<!-- $$$indexOf[overload1]$$$indexOfconstQByteArray&int -->
<h3 class="fn"><a name="indexOf"></a><span class="type">int</span> QByteArray::<span class="name">indexOf</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i>, <span class="type">int</span> <i>from</i> = 0 ) const</h3>
<p>Returns the index position of the first occurrence of the byte array <i>ba</i> in this byte array, searching forward from index position <i>from</i>. Returns -1 if <i>ba</i> could not be found.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;sticky question&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y(<span class="string">&quot;sti&quot;</span>);
 x<span class="operator">.</span>indexOf(y);               <span class="comment">// returns 0</span>
 x<span class="operator">.</span>indexOf(y<span class="operator">,</span> <span class="number">1</span>);            <span class="comment">// returns 10</span>
 x<span class="operator">.</span>indexOf(y<span class="operator">,</span> <span class="number">10</span>);           <span class="comment">// returns 10</span>
 x<span class="operator">.</span>indexOf(y<span class="operator">,</span> <span class="number">11</span>);           <span class="comment">// returns -1</span></pre>
<p><b>See also </b><a href="qbytearray.html#lastIndexOf">lastIndexOf</a>(), <a href="qbytearray.html#contains">contains</a>(), and <a href="qbytearray.html#count">count</a>().</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfconstQString&int -->
<h3 class="fn"><a name="indexOf-2"></a><span class="type">int</span> QByteArray::<span class="name">indexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = 0 ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the index position of the first occurrence of the string <i>str</i> in the byte array, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> could not be found.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>If the <a href="qstring.html">QString</a> contains non-ASCII Unicode characters, using this function can lead to loss of information. You can disable this function by defining <tt>QT_NO_CAST_TO_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#toAscii">QString::toAscii</a>() (or <a href="qstring.html#toLatin1">QString::toLatin1</a>() or <a href="qstring.html#toUtf8">QString::toUtf8</a>() or <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>()) explicitly if you want to convert the data to <tt>const char *</tt>.</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfconstchar*int -->
<h3 class="fn"><a name="indexOf-3"></a><span class="type">int</span> QByteArray::<span class="name">indexOf</span> ( const <span class="type">char</span> * <i>str</i>, <span class="type">int</span> <i>from</i> = 0 ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the index position of the first occurrence of the string <i>str</i> in the byte array, searching forward from index position <i>from</i>. Returns -1 if <i>str</i> could not be found.</p>
<!-- @@@indexOf -->
<!-- $$$indexOf$$$indexOfcharint -->
<h3 class="fn"><a name="indexOf-4"></a><span class="type">int</span> QByteArray::<span class="name">indexOf</span> ( <span class="type">char</span> <i>ch</i>, <span class="type">int</span> <i>from</i> = 0 ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the index position of the first occurrence of the character <i>ch</i> in the byte array, searching forward from index position <i>from</i>. Returns -1 if <i>ch</i> could not be found.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;ABCBA&quot;</span>);
 ba<span class="operator">.</span>indexOf(<span class="string">&quot;B&quot;</span>);            <span class="comment">// returns 1</span>
 ba<span class="operator">.</span>indexOf(<span class="string">&quot;B&quot;</span><span class="operator">,</span> <span class="number">1</span>);         <span class="comment">// returns 1</span>
 ba<span class="operator">.</span>indexOf(<span class="string">&quot;B&quot;</span><span class="operator">,</span> <span class="number">2</span>);         <span class="comment">// returns 3</span>
 ba<span class="operator">.</span>indexOf(<span class="string">&quot;X&quot;</span>);            <span class="comment">// returns -1</span></pre>
<p><b>See also </b><a href="qbytearray.html#lastIndexOf">lastIndexOf</a>() and <a href="qbytearray.html#contains">contains</a>().</p>
<!-- @@@indexOf -->
<!-- $$$insert[overload1]$$$insertintconstQByteArray& -->
<h3 class="fn"><a name="insert"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">insert</span> ( <span class="type">int</span> <i>i</i>, const <span class="type">QByteArray</span> &amp; <i>ba</i> )</h3>
<p>Inserts the byte array <i>ba</i> at index position <i>i</i> and returns a reference to this byte array.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;Meal&quot;</span>);
 ba<span class="operator">.</span>insert(<span class="number">1</span><span class="operator">,</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;ontr&quot;</span>));
 <span class="comment">// ba == &quot;Montreal&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#append">append</a>(), <a href="qbytearray.html#prepend">prepend</a>(), <a href="qbytearray.html#replace">replace</a>(), and <a href="qbytearray.html#remove">remove</a>().</p>
<!-- @@@insert -->
<!-- $$$insert$$$insertintconstQString& -->
<h3 class="fn"><a name="insert-2"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">insert</span> ( <span class="type">int</span> <i>i</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Inserts the string <i>str</i> at index position <i>i</i> in the byte array. The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>If <i>i</i> is greater than <a href="qbytearray.html#size">size</a>(), the array is first extended using <a href="qbytearray.html#resize">resize</a>().</p>
<p>If the <a href="qstring.html">QString</a> contains non-ASCII Unicode characters, using this function can lead to loss of information. You can disable this function by defining <tt>QT_NO_CAST_TO_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#toAscii">QString::toAscii</a>() (or <a href="qstring.html#toLatin1">QString::toLatin1</a>() or <a href="qstring.html#toUtf8">QString::toUtf8</a>() or <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>()) explicitly if you want to convert the data to <tt>const char *</tt>.</p>
<!-- @@@insert -->
<!-- $$$insert$$$insertintconstchar* -->
<h3 class="fn"><a name="insert-3"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">insert</span> ( <span class="type">int</span> <i>i</i>, const <span class="type">char</span> * <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Inserts the string <i>str</i> at position <i>i</i> in the byte array.</p>
<p>If <i>i</i> is greater than <a href="qbytearray.html#size">size</a>(), the array is first extended using <a href="qbytearray.html#resize">resize</a>().</p>
<!-- @@@insert -->
<!-- $$$insert$$$insertintconstchar*int -->
<h3 class="fn"><a name="insert-4"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">insert</span> ( <span class="type">int</span> <i>i</i>, const <span class="type">char</span> * <i>str</i>, <span class="type">int</span> <i>len</i> )</h3>
<p>This is an overloaded function.</p>
<p>Inserts <i>len</i> bytes of the string <i>str</i> at position <i>i</i> in the byte array.</p>
<p>If <i>i</i> is greater than <a href="qbytearray.html#size">size</a>(), the array is first extended using <a href="qbytearray.html#resize">resize</a>().</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@insert -->
<!-- $$$insert$$$insertintchar -->
<h3 class="fn"><a name="insert-5"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">insert</span> ( <span class="type">int</span> <i>i</i>, <span class="type">char</span> <i>ch</i> )</h3>
<p>This is an overloaded function.</p>
<p>Inserts character <i>ch</i> at index position <i>i</i> in the byte array. If <i>i</i> is greater than <a href="qbytearray.html#size">size</a>(), the array is first extended using <a href="qbytearray.html#resize">resize</a>().</p>
<!-- @@@insert -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QByteArray::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if the byte array has size 0; otherwise returns false.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span>()<span class="operator">.</span>isEmpty();         <span class="comment">// returns true</span>
 <span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;&quot;</span>)<span class="operator">.</span>isEmpty();       <span class="comment">// returns true</span>
 <span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;abc&quot;</span>)<span class="operator">.</span>isEmpty();    <span class="comment">// returns false</span></pre>
<p><b>See also </b><a href="qbytearray.html#size">size</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QByteArray::<span class="name">isNull</span> () const</h3>
<p>Returns true if this byte array is null; otherwise returns false.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span>()<span class="operator">.</span>isNull();          <span class="comment">// returns true</span>
 <span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;&quot;</span>)<span class="operator">.</span>isNull();        <span class="comment">// returns false</span>
 <span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;abc&quot;</span>)<span class="operator">.</span>isNull();     <span class="comment">// returns false</span></pre>
<p>Qt makes a distinction between null byte arrays and empty byte arrays for historical reasons. For most applications, what matters is whether or not a byte array contains any data, and this can be determined using <a href="qbytearray.html#isEmpty">isEmpty</a>().</p>
<p><b>See also </b><a href="qbytearray.html#isEmpty">isEmpty</a>().</p>
<!-- @@@isNull -->
<!-- $$$lastIndexOf[overload1]$$$lastIndexOfconstQByteArray&int -->
<h3 class="fn"><a name="lastIndexOf"></a><span class="type">int</span> QByteArray::<span class="name">lastIndexOf</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i>, <span class="type">int</span> <i>from</i> = -1 ) const</h3>
<p>Returns the index position of the last occurrence of the byte array <i>ba</i> in this byte array, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last byte. Returns -1 if <i>ba</i> could not be found.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;crazy azimuths&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y(<span class="string">&quot;az&quot;</span>);
 x<span class="operator">.</span>lastIndexOf(y);           <span class="comment">// returns 6</span>
 x<span class="operator">.</span>lastIndexOf(y<span class="operator">,</span> <span class="number">6</span>);        <span class="comment">// returns 6</span>
 x<span class="operator">.</span>lastIndexOf(y<span class="operator">,</span> <span class="number">5</span>);        <span class="comment">// returns 2</span>
 x<span class="operator">.</span>lastIndexOf(y<span class="operator">,</span> <span class="number">1</span>);        <span class="comment">// returns -1</span></pre>
<p><b>See also </b><a href="qbytearray.html#indexOf">indexOf</a>(), <a href="qbytearray.html#contains">contains</a>(), and <a href="qbytearray.html#count">count</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfconstQString&int -->
<h3 class="fn"><a name="lastIndexOf-2"></a><span class="type">int</span> QByteArray::<span class="name">lastIndexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i>, <span class="type">int</span> <i>from</i> = -1 ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the index position of the last occurrence of the string <i>str</i> in the byte array, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last (<a href="qbytearray.html#size">size</a>() - 1) byte. Returns -1 if <i>str</i> could not be found.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>If the <a href="qstring.html">QString</a> contains non-ASCII Unicode characters, using this function can lead to loss of information. You can disable this function by defining <tt>QT_NO_CAST_TO_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#toAscii">QString::toAscii</a>() (or <a href="qstring.html#toLatin1">QString::toLatin1</a>() or <a href="qstring.html#toUtf8">QString::toUtf8</a>() or <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>()) explicitly if you want to convert the data to <tt>const char *</tt>.</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfconstchar*int -->
<h3 class="fn"><a name="lastIndexOf-3"></a><span class="type">int</span> QByteArray::<span class="name">lastIndexOf</span> ( const <span class="type">char</span> * <i>str</i>, <span class="type">int</span> <i>from</i> = -1 ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the index position of the last occurrence of the string <i>str</i> in the byte array, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last (<a href="qbytearray.html#size">size</a>() - 1) byte. Returns -1 if <i>str</i> could not be found.</p>
<!-- @@@lastIndexOf -->
<!-- $$$lastIndexOf$$$lastIndexOfcharint -->
<h3 class="fn"><a name="lastIndexOf-4"></a><span class="type">int</span> QByteArray::<span class="name">lastIndexOf</span> ( <span class="type">char</span> <i>ch</i>, <span class="type">int</span> <i>from</i> = -1 ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the index position of the last occurrence of character <i>ch</i> in the byte array, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last (<a href="qbytearray.html#size">size</a>() - 1) byte. Returns -1 if <i>ch</i> could not be found.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;ABCBA&quot;</span>);
 ba<span class="operator">.</span>lastIndexOf(<span class="string">&quot;B&quot;</span>);        <span class="comment">// returns 3</span>
 ba<span class="operator">.</span>lastIndexOf(<span class="string">&quot;B&quot;</span><span class="operator">,</span> <span class="number">3</span>);     <span class="comment">// returns 3</span>
 ba<span class="operator">.</span>lastIndexOf(<span class="string">&quot;B&quot;</span><span class="operator">,</span> <span class="number">2</span>);     <span class="comment">// returns 1</span>
 ba<span class="operator">.</span>lastIndexOf(<span class="string">&quot;X&quot;</span>);        <span class="comment">// returns -1</span></pre>
<p><b>See also </b><a href="qbytearray.html#indexOf">indexOf</a>() and <a href="qbytearray.html#contains">contains</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$left[overload1]$$$leftint -->
<h3 class="fn"><a name="left"></a><span class="type">QByteArray</span> QByteArray::<span class="name">left</span> ( <span class="type">int</span> <i>len</i> ) const</h3>
<p>Returns a byte array that contains the leftmost <i>len</i> bytes of this byte array.</p>
<p>The entire byte array is returned if <i>len</i> is greater than <a href="qbytearray.html#size">size</a>().</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;Pineapple&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y <span class="operator">=</span> x<span class="operator">.</span>left(<span class="number">4</span>);
 <span class="comment">// y == &quot;Pine&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#right">right</a>(), <a href="qbytearray.html#mid">mid</a>(), <a href="qbytearray.html#startsWith">startsWith</a>(), and <a href="qbytearray.html#truncate">truncate</a>().</p>
<!-- @@@left -->
<!-- $$$leftJustified[overload1]$$$leftJustifiedintcharbool -->
<h3 class="fn"><a name="leftJustified"></a><span class="type">QByteArray</span> QByteArray::<span class="name">leftJustified</span> ( <span class="type">int</span> <i>width</i>, <span class="type">char</span> <i>fill</i> = ' ', <span class="type">bool</span> <i>truncate</i> = false ) const</h3>
<p>Returns a byte array of size <i>width</i> that contains this byte array padded by the <i>fill</i> character.</p>
<p>If <i>truncate</i> is false and the <a href="qbytearray.html#size">size</a>() of the byte array is more than <i>width</i>, then the returned byte array is a copy of this byte array.</p>
<p>If <i>truncate</i> is true and the <a href="qbytearray.html#size">size</a>() of the byte array is more than <i>width</i>, then any bytes in a copy of the byte array after position <i>width</i> are removed, and the copy is returned.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;apple&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y <span class="operator">=</span> x<span class="operator">.</span>leftJustified(<span class="number">8</span><span class="operator">,</span> <span class="char">'.'</span>);   <span class="comment">// y == &quot;apple...&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#rightJustified">rightJustified</a>().</p>
<!-- @@@leftJustified -->
<!-- $$$length[overload1]$$$length -->
<h3 class="fn"><a name="length"></a><span class="type">int</span> QByteArray::<span class="name">length</span> () const</h3>
<p>Same as <a href="qbytearray.html#size">size</a>().</p>
<!-- @@@length -->
<!-- $$$mid[overload1]$$$midintint -->
<h3 class="fn"><a name="mid"></a><span class="type">QByteArray</span> QByteArray::<span class="name">mid</span> ( <span class="type">int</span> <i>pos</i>, <span class="type">int</span> <i>len</i> = -1 ) const</h3>
<p>Returns a byte array containing <i>len</i> bytes from this byte array, starting at position <i>pos</i>.</p>
<p>If <i>len</i> is -1 (the default), or <i>pos</i> + <i>len</i> &gt;= <a href="qbytearray.html#size">size</a>(), returns a byte array containing all bytes starting at position <i>pos</i> until the end of the byte array.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;Five pineapples&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y <span class="operator">=</span> x<span class="operator">.</span>mid(<span class="number">5</span><span class="operator">,</span> <span class="number">4</span>);     <span class="comment">// y == &quot;pine&quot;</span>
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> z <span class="operator">=</span> x<span class="operator">.</span>mid(<span class="number">5</span>);        <span class="comment">// z == &quot;pineapples&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#left">left</a>() and <a href="qbytearray.html#right">right</a>().</p>
<!-- @@@mid -->
<!-- $$$number[overload1]$$$numberintint -->
<h3 class="fn"><a name="number"></a><span class="type">QByteArray</span> QByteArray::<span class="name">number</span> ( <span class="type">int</span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )<tt> [static]</tt></h3>
<p>Returns a byte array containing the string equivalent of the number <i>n</i> to base <i>base</i> (10 by default). The <i>base</i> can be any value between 2 and 36.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type">int</span> n <span class="operator">=</span> <span class="number">63</span>;
 <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>number(n);              <span class="comment">// returns &quot;63&quot;</span>
 <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>number(n<span class="operator">,</span> <span class="number">16</span>);          <span class="comment">// returns &quot;3f&quot;</span>
 <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>number(n<span class="operator">,</span> <span class="number">16</span>)<span class="operator">.</span>toUpper();  <span class="comment">// returns &quot;3F&quot;</span></pre>
<p><b>Note:</b> The format of the number is not localized; the default C locale is used irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#setNum">setNum</a>() and <a href="qbytearray.html#toInt">toInt</a>().</p>
<!-- @@@number -->
<!-- $$$number$$$numberuintint -->
<h3 class="fn"><a name="number-2"></a><span class="type">QByteArray</span> QByteArray::<span class="name">number</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toUInt">toUInt</a>().</p>
<!-- @@@number -->
<!-- $$$number$$$numberqlonglongint -->
<h3 class="fn"><a name="number-3"></a><span class="type">QByteArray</span> QByteArray::<span class="name">number</span> ( <span class="type"><a href="qtglobal.html#qlonglong-typedef">qlonglong</a></span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toLongLong">toLongLong</a>().</p>
<!-- @@@number -->
<!-- $$$number$$$numberqulonglongint -->
<h3 class="fn"><a name="number-4"></a><span class="type">QByteArray</span> QByteArray::<span class="name">number</span> ( <span class="type"><a href="qtglobal.html#qulonglong-typedef">qulonglong</a></span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toULongLong">toULongLong</a>().</p>
<!-- @@@number -->
<!-- $$$number$$$numberdoublecharint -->
<h3 class="fn"><a name="number-5"></a><span class="type">QByteArray</span> QByteArray::<span class="name">number</span> ( <span class="type">double</span> <i>n</i>, <span class="type">char</span> <i>f</i> = 'g', <span class="type">int</span> <i>prec</i> = 6 )<tt> [static]</tt></h3>
<p>This is an overloaded function.</p>
<p>Returns a byte array that contains the printed value of <i>n</i>, formatted in format <i>f</i> with precision <i>prec</i>.</p>
<p>Argument <i>n</i> is formatted according to the <i>f</i> format specified, which is <tt>g</tt> by default, and can be any of the following:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Format</th><th >Meaning</th></tr></thead>
<tr valign="top" class="odd"><td ><tt>e</tt></td><td >format as [-]9.9e[+|-]999</td></tr>
<tr valign="top" class="even"><td ><tt>E</tt></td><td >format as [-]9.9E[+|-]999</td></tr>
<tr valign="top" class="odd"><td ><tt>f</tt></td><td >format as [-]9.9</td></tr>
<tr valign="top" class="even"><td ><tt>g</tt></td><td >use <tt>e</tt> or <tt>f</tt> format, whichever is the most concise</td></tr>
<tr valign="top" class="odd"><td ><tt>G</tt></td><td >use <tt>E</tt> or <tt>f</tt> format, whichever is the most concise</td></tr>
</table>
<p>With 'e', 'E', and 'f', <i>prec</i> is the number of digits after the decimal point. With 'g' and 'G', <i>prec</i> is the maximum number of significant digits (trailing zeroes are omitted).</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba <span class="operator">=</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span><span class="operator">::</span>number(<span class="number">12.3456</span><span class="operator">,</span> <span class="char">'E'</span><span class="operator">,</span> <span class="number">3</span>);
 <span class="comment">// ba == 1.235E+01</span></pre>
<p><b>Note:</b> The format of the number is not localized; the default C locale is used irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#toDouble">toDouble</a>().</p>
<!-- @@@number -->
<!-- $$$prepend[overload1]$$$prependconstQByteArray& -->
<h3 class="fn"><a name="prepend"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">prepend</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i> )</h3>
<p>Prepends the byte array <i>ba</i> to this byte array and returns a reference to this byte array.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;ship&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y(<span class="string">&quot;air&quot;</span>);
 x<span class="operator">.</span>prepend(y);
 <span class="comment">// x == &quot;airship&quot;</span></pre>
<p>This is the same as insert(0, <i>ba</i>).</p>
<p>Note: <a href="qbytearray.html">QByteArray</a> is an <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a> class. Consequently, if <i>this</i> is an empty <a href="qbytearray.html">QByteArray</a>, then <i>this</i> will just share the data held in <i>ba</i>. In this case, no copying of data is done, taking <a href="containers.html#constant-time">constant time</a>. If a shared instance is modified, it will be copied (copy-on-write), taking <a href="containers.html#linear-time">linear time</a>.</p>
<p>If <i>this</i> is not an empty <a href="qbytearray.html">QByteArray</a>, a deep copy of the data is performed, taking <a href="containers.html#linear-time">linear time</a>.</p>
<p><b>See also </b><a href="qbytearray.html#append">append</a>() and <a href="qbytearray.html#insert">insert</a>().</p>
<!-- @@@prepend -->
<!-- $$$prepend$$$prependconstchar* -->
<h3 class="fn"><a name="prepend-2"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">prepend</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Prepends the string <i>str</i> to this byte array.</p>
<!-- @@@prepend -->
<!-- $$$prepend$$$prependconstchar*int -->
<h3 class="fn"><a name="prepend-3"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">prepend</span> ( const <span class="type">char</span> * <i>str</i>, <span class="type">int</span> <i>len</i> )</h3>
<p>This is an overloaded function.</p>
<p>Prepends <i>len</i> bytes of the string <i>str</i> to this byte array.</p>
<p>This function was introduced in Qt 4.6.</p>
<!-- @@@prepend -->
<!-- $$$prepend$$$prependchar -->
<h3 class="fn"><a name="prepend-4"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">prepend</span> ( <span class="type">char</span> <i>ch</i> )</h3>
<p>This is an overloaded function.</p>
<p>Prepends the character <i>ch</i> to this byte array.</p>
<!-- @@@prepend -->
<!-- $$$push_back[overload1]$$$push_backconstQByteArray& -->
<h3 class="fn"><a name="push_back"></a><span class="type">void</span> QByteArray::<span class="name">push_back</span> ( const <span class="type">QByteArray</span> &amp; <i>other</i> )</h3>
<p>This function is provided for STL compatibility. It is equivalent to append(<i>other</i>).</p>
<!-- @@@push_back -->
<!-- $$$push_back$$$push_backconstchar* -->
<h3 class="fn"><a name="push_back-2"></a><span class="type">void</span> QByteArray::<span class="name">push_back</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Same as append(<i>str</i>).</p>
<!-- @@@push_back -->
<!-- $$$push_back$$$push_backchar -->
<h3 class="fn"><a name="push_back-3"></a><span class="type">void</span> QByteArray::<span class="name">push_back</span> ( <span class="type">char</span> <i>ch</i> )</h3>
<p>This is an overloaded function.</p>
<p>Same as append(<i>ch</i>).</p>
<!-- @@@push_back -->
<!-- $$$push_front[overload1]$$$push_frontconstQByteArray& -->
<h3 class="fn"><a name="push_front"></a><span class="type">void</span> QByteArray::<span class="name">push_front</span> ( const <span class="type">QByteArray</span> &amp; <i>other</i> )</h3>
<p>This function is provided for STL compatibility. It is equivalent to prepend(<i>other</i>).</p>
<!-- @@@push_front -->
<!-- $$$push_front$$$push_frontconstchar* -->
<h3 class="fn"><a name="push_front-2"></a><span class="type">void</span> QByteArray::<span class="name">push_front</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Same as prepend(<i>str</i>).</p>
<!-- @@@push_front -->
<!-- $$$push_front$$$push_frontchar -->
<h3 class="fn"><a name="push_front-3"></a><span class="type">void</span> QByteArray::<span class="name">push_front</span> ( <span class="type">char</span> <i>ch</i> )</h3>
<p>This is an overloaded function.</p>
<p>Same as prepend(<i>ch</i>).</p>
<!-- @@@push_front -->
<!-- $$$remove[overload1]$$$removeintint -->
<h3 class="fn"><a name="remove"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">remove</span> ( <span class="type">int</span> <i>pos</i>, <span class="type">int</span> <i>len</i> )</h3>
<p>Removes <i>len</i> bytes from the array, starting at index position <i>pos</i>, and returns a reference to the array.</p>
<p>If <i>pos</i> is out of range, nothing happens. If <i>pos</i> is valid, but <i>pos</i> + <i>len</i> is larger than the size of the array, the array is truncated at position <i>pos</i>.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;Montreal&quot;</span>);
 ba<span class="operator">.</span>remove(<span class="number">1</span><span class="operator">,</span> <span class="number">4</span>);
 <span class="comment">// ba == &quot;Meal&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#insert">insert</a>() and <a href="qbytearray.html#replace">replace</a>().</p>
<!-- @@@remove -->
<!-- $$$repeated[overload1]$$$repeatedint -->
<h3 class="fn"><a name="repeated"></a><span class="type">QByteArray</span> QByteArray::<span class="name">repeated</span> ( <span class="type">int</span> <i>times</i> ) const</h3>
<p>Returns a copy of this byte array repeated the specified number of <i>times</i>.</p>
<p>If <i>times</i> is less than 1, an empty byte array is returned.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;ab&quot;</span>);
 ba<span class="operator">.</span>repeated(<span class="number">4</span>);             <span class="comment">// returns &quot;abababab&quot;</span></pre>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@repeated -->
<!-- $$$replace[overload1]$$$replaceintintconstQByteArray& -->
<h3 class="fn"><a name="replace"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( <span class="type">int</span> <i>pos</i>, <span class="type">int</span> <i>len</i>, const <span class="type">QByteArray</span> &amp; <i>after</i> )</h3>
<p>Replaces <i>len</i> bytes from index position <i>pos</i> with the byte array <i>after</i>, and returns a reference to this byte array.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;Say yes!&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y(<span class="string">&quot;no&quot;</span>);
 x<span class="operator">.</span>replace(<span class="number">4</span><span class="operator">,</span> <span class="number">3</span><span class="operator">,</span> y);
 <span class="comment">// x == &quot;Say no!&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#insert">insert</a>() and <a href="qbytearray.html#remove">remove</a>().</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceintintconstchar* -->
<h3 class="fn"><a name="replace-2"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( <span class="type">int</span> <i>pos</i>, <span class="type">int</span> <i>len</i>, const <span class="type">char</span> * <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces <i>len</i> bytes from index position <i>pos</i> with the zero terminated string <i>after</i>.</p>
<p>Notice: this can change the length of the byte array.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceintintconstchar*int -->
<h3 class="fn"><a name="replace-3"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( <span class="type">int</span> <i>pos</i>, <span class="type">int</span> <i>len</i>, const <span class="type">char</span> * <i>after</i>, <span class="type">int</span> <i>alen</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces <i>len</i> bytes from index position <i>pos</i> with <i>alen</i> bytes from the string <i>after</i>. <i>after</i> is allowed to have '\0' characters.</p>
<p>This function was introduced in Qt 4.7.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceconstQByteArray&constQByteArray& -->
<h3 class="fn"><a name="replace-4"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( const <span class="type">QByteArray</span> &amp; <i>before</i>, const <span class="type">QByteArray</span> &amp; <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the byte array <i>before</i> with the byte array <i>after</i>.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;colour behaviour flavour neighbour&quot;</span>);
 ba<span class="operator">.</span>replace(<span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;ou&quot;</span>)<span class="operator">,</span> <span class="type"><a href="qbytearray.html">QByteArray</a></span>(<span class="string">&quot;o&quot;</span>));
 <span class="comment">// ba == &quot;color behavior flavor neighbor&quot;</span></pre>
<!-- @@@replace -->
<!-- $$$replace$$$replaceconstchar*constQByteArray& -->
<h3 class="fn"><a name="replace-5"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( const <span class="type">char</span> * <i>before</i>, const <span class="type">QByteArray</span> &amp; <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the string <i>before</i> with the byte array <i>after</i>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceconstchar*intconstchar*int -->
<h3 class="fn"><a name="replace-6"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( const <span class="type">char</span> * <i>before</i>, <span class="type">int</span> <i>bsize</i>, const <span class="type">char</span> * <i>after</i>, <span class="type">int</span> <i>asize</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the string <i>before</i> with the string <i>after</i>. Since the sizes of the strings are given by <i>bsize</i> and <i>asize</i>, they may contain zero characters and do not need to be zero-terminated.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceconstQByteArray&constchar* -->
<h3 class="fn"><a name="replace-7"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( const <span class="type">QByteArray</span> &amp; <i>before</i>, const <span class="type">char</span> * <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the byte array <i>before</i> with the string <i>after</i>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceconstQString&constQByteArray& -->
<h3 class="fn"><a name="replace-8"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>before</i>, const <span class="type">QByteArray</span> &amp; <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the string <i>before</i> with the byte array <i>after</i>. The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>If the <a href="qstring.html">QString</a> contains non-ASCII Unicode characters, using this function can lead to loss of information. You can disable this function by defining <tt>QT_NO_CAST_TO_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#toAscii">QString::toAscii</a>() (or <a href="qstring.html#toLatin1">QString::toLatin1</a>() or <a href="qstring.html#toUtf8">QString::toUtf8</a>() or <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>()) explicitly if you want to convert the data to <tt>const char *</tt>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceconstQString&constchar* -->
<h3 class="fn"><a name="replace-9"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>before</i>, const <span class="type">char</span> * <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the string <i>before</i> with the string <i>after</i>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replaceconstchar*constchar* -->
<h3 class="fn"><a name="replace-10"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( const <span class="type">char</span> * <i>before</i>, const <span class="type">char</span> * <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the string <i>before</i> with the string <i>after</i>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replacecharconstQByteArray& -->
<h3 class="fn"><a name="replace-11"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( <span class="type">char</span> <i>before</i>, const <span class="type">QByteArray</span> &amp; <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the character <i>before</i> with the byte array <i>after</i>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replacecharconstQString& -->
<h3 class="fn"><a name="replace-12"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( <span class="type">char</span> <i>before</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the character <i>before</i> with the string <i>after</i>. The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>If the <a href="qstring.html">QString</a> contains non-ASCII Unicode characters, using this function can lead to loss of information. You can disable this function by defining <tt>QT_NO_CAST_TO_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#toAscii">QString::toAscii</a>() (or <a href="qstring.html#toLatin1">QString::toLatin1</a>() or <a href="qstring.html#toUtf8">QString::toUtf8</a>() or <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>()) explicitly if you want to convert the data to <tt>const char *</tt>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replacecharconstchar* -->
<h3 class="fn"><a name="replace-13"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( <span class="type">char</span> <i>before</i>, const <span class="type">char</span> * <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the character <i>before</i> with the string <i>after</i>.</p>
<!-- @@@replace -->
<!-- $$$replace$$$replacecharchar -->
<h3 class="fn"><a name="replace-14"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">replace</span> ( <span class="type">char</span> <i>before</i>, <span class="type">char</span> <i>after</i> )</h3>
<p>This is an overloaded function.</p>
<p>Replaces every occurrence of the character <i>before</i> with the character <i>after</i>.</p>
<!-- @@@replace -->
<!-- $$$reserve[overload1]$$$reserveint -->
<h3 class="fn"><a name="reserve"></a><span class="type">void</span> QByteArray::<span class="name">reserve</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Attempts to allocate memory for at least <i>size</i> bytes. If you know in advance how large the byte array will be, you can call this function, and if you call <a href="qbytearray.html#resize">resize</a>() often you are likely to get better performance. If <i>size</i> is an underestimate, the worst that will happen is that the <a href="qbytearray.html">QByteArray</a> will be a bit slower.</p>
<p>The sole purpose of this function is to provide a means of fine tuning <a href="qbytearray.html">QByteArray</a>'s memory usage. In general, you will rarely ever need to call this function. If you want to change the size of the byte array, call <a href="qbytearray.html#resize">resize</a>().</p>
<p><b>See also </b><a href="qbytearray.html#squeeze">squeeze</a>() and <a href="qbytearray.html#capacity">capacity</a>().</p>
<!-- @@@reserve -->
<!-- $$$resize[overload1]$$$resizeint -->
<h3 class="fn"><a name="resize"></a><span class="type">void</span> QByteArray::<span class="name">resize</span> ( <span class="type">int</span> <i>size</i> )</h3>
<p>Sets the size of the byte array to <i>size</i> bytes.</p>
<p>If <i>size</i> is greater than the current size, the byte array is extended to make it <i>size</i> bytes with the extra bytes added to the end. The new bytes are uninitialized.</p>
<p>If <i>size</i> is less than the current size, bytes are removed from the end.</p>
<p><b>See also </b><a href="qbytearray.html#size">size</a>() and <a href="qbytearray.html#truncate">truncate</a>().</p>
<!-- @@@resize -->
<!-- $$$right[overload1]$$$rightint -->
<h3 class="fn"><a name="right"></a><span class="type">QByteArray</span> QByteArray::<span class="name">right</span> ( <span class="type">int</span> <i>len</i> ) const</h3>
<p>Returns a byte array that contains the rightmost <i>len</i> bytes of this byte array.</p>
<p>The entire byte array is returned if <i>len</i> is greater than <a href="qbytearray.html#size">size</a>().</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;Pineapple&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y <span class="operator">=</span> x<span class="operator">.</span>right(<span class="number">5</span>);
 <span class="comment">// y == &quot;apple&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#endsWith">endsWith</a>(), <a href="qbytearray.html#left">left</a>(), and <a href="qbytearray.html#mid">mid</a>().</p>
<!-- @@@right -->
<!-- $$$rightJustified[overload1]$$$rightJustifiedintcharbool -->
<h3 class="fn"><a name="rightJustified"></a><span class="type">QByteArray</span> QByteArray::<span class="name">rightJustified</span> ( <span class="type">int</span> <i>width</i>, <span class="type">char</span> <i>fill</i> = ' ', <span class="type">bool</span> <i>truncate</i> = false ) const</h3>
<p>Returns a byte array of size <i>width</i> that contains the <i>fill</i> character followed by this byte array.</p>
<p>If <i>truncate</i> is false and the size of the byte array is more than <i>width</i>, then the returned byte array is a copy of this byte array.</p>
<p>If <i>truncate</i> is true and the size of the byte array is more than <i>width</i>, then the resulting byte array is truncated at position <i>width</i>.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;apple&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y <span class="operator">=</span> x<span class="operator">.</span>rightJustified(<span class="number">8</span><span class="operator">,</span> <span class="char">'.'</span>);    <span class="comment">// y == &quot;...apple&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#leftJustified">leftJustified</a>().</p>
<!-- @@@rightJustified -->
<!-- $$$setNum[overload1]$$$setNumintint -->
<h3 class="fn"><a name="setNum"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type">int</span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )</h3>
<p>Sets the byte array to the printed value of <i>n</i> in base <i>base</i> (10 by default) and returns a reference to the byte array. The <i>base</i> can be any value between 2 and 36.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba;
 <span class="type">int</span> n <span class="operator">=</span> <span class="number">63</span>;
 ba<span class="operator">.</span>setNum(n);           <span class="comment">// ba == &quot;63&quot;</span>
 ba<span class="operator">.</span>setNum(n<span class="operator">,</span> <span class="number">16</span>);       <span class="comment">// ba == &quot;3f&quot;</span></pre>
<p><b>Note:</b> The format of the number is not localized; the default C locale is used irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>() and <a href="qbytearray.html#toInt">toInt</a>().</p>
<!-- @@@setNum -->
<!-- $$$setNum$$$setNumuintint -->
<h3 class="fn"><a name="setNum-2"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )</h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toUInt">toUInt</a>().</p>
<!-- @@@setNum -->
<!-- $$$setNum$$$setNumshortint -->
<h3 class="fn"><a name="setNum-3"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type">short</span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )</h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toShort">toShort</a>().</p>
<!-- @@@setNum -->
<!-- $$$setNum$$$setNumushortint -->
<h3 class="fn"><a name="setNum-4"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type"><a href="qtglobal.html#ushort-typedef">ushort</a></span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )</h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toUShort">toUShort</a>().</p>
<!-- @@@setNum -->
<!-- $$$setNum$$$setNumqlonglongint -->
<h3 class="fn"><a name="setNum-5"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type"><a href="qtglobal.html#qlonglong-typedef">qlonglong</a></span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )</h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toLongLong">toLongLong</a>().</p>
<!-- @@@setNum -->
<!-- $$$setNum$$$setNumqulonglongint -->
<h3 class="fn"><a name="setNum-6"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type"><a href="qtglobal.html#qulonglong-typedef">qulonglong</a></span> <i>n</i>, <span class="type">int</span> <i>base</i> = 10 )</h3>
<p>This is an overloaded function.</p>
<p><b>See also </b><a href="qbytearray.html#toULongLong">toULongLong</a>().</p>
<!-- @@@setNum -->
<!-- $$$setNum$$$setNumdoublecharint -->
<h3 class="fn"><a name="setNum-7"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type">double</span> <i>n</i>, <span class="type">char</span> <i>f</i> = 'g', <span class="type">int</span> <i>prec</i> = 6 )</h3>
<p>This is an overloaded function.</p>
<p>Sets the byte array to the printed value of <i>n</i>, formatted in format <i>f</i> with precision <i>prec</i>, and returns a reference to the byte array.</p>
<p>The format <i>f</i> can be any of the following:</p>
<table class="generic">
<thead><tr class="qt-style"><th >Format</th><th >Meaning</th></tr></thead>
<tr valign="top" class="odd"><td ><tt>e</tt></td><td >format as [-]9.9e[+|-]999</td></tr>
<tr valign="top" class="even"><td ><tt>E</tt></td><td >format as [-]9.9E[+|-]999</td></tr>
<tr valign="top" class="odd"><td ><tt>f</tt></td><td >format as [-]9.9</td></tr>
<tr valign="top" class="even"><td ><tt>g</tt></td><td >use <tt>e</tt> or <tt>f</tt> format, whichever is the most concise</td></tr>
<tr valign="top" class="odd"><td ><tt>G</tt></td><td >use <tt>E</tt> or <tt>f</tt> format, whichever is the most concise</td></tr>
</table>
<p>With 'e', 'E', and 'f', <i>prec</i> is the number of digits after the decimal point. With 'g' and 'G', <i>prec</i> is the maximum number of significant digits (trailing zeroes are omitted).</p>
<p><b>Note:</b> The format of the number is not localized; the default C locale is used irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#toDouble">toDouble</a>().</p>
<!-- @@@setNum -->
<!-- $$$setNum$$$setNumfloatcharint -->
<h3 class="fn"><a name="setNum-8"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setNum</span> ( <span class="type">float</span> <i>n</i>, <span class="type">char</span> <i>f</i> = 'g', <span class="type">int</span> <i>prec</i> = 6 )</h3>
<p>This is an overloaded function.</p>
<p>Sets the byte array to the printed value of <i>n</i>, formatted in format <i>f</i> with precision <i>prec</i>, and returns a reference to the byte array.</p>
<p><b>Note:</b> The format of the number is not localized; the default C locale is used irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#toFloat">toFloat</a>().</p>
<!-- @@@setNum -->
<!-- $$$setRawData[overload1]$$$setRawDataconstchar*uint -->
<h3 class="fn"><a name="setRawData"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">setRawData</span> ( const <span class="type">char</span> * <i>data</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>size</i> )</h3>
<p>Resets the <a href="qbytearray.html">QByteArray</a> to use the first <i>size</i> bytes of the <i>data</i> array. The bytes are <i>not</i> copied. The <a href="qbytearray.html">QByteArray</a> will contain the <i>data</i> pointer. The caller guarantees that <i>data</i> will not be deleted or modified as long as this <a href="qbytearray.html">QByteArray</a> and any copies of it exist that have not been modified.</p>
<p>This function can be used instead of <a href="qbytearray.html#fromRawData">fromRawData</a>() to re-use existings <a href="qbytearray.html">QByteArray</a> objects to save memory re-allocations.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qbytearray.html#fromRawData">fromRawData</a>(), <a href="qbytearray.html#data">data</a>(), and <a href="qbytearray.html#constData">constData</a>().</p>
<!-- @@@setRawData -->
<!-- $$$simplified[overload1]$$$simplified -->
<h3 class="fn"><a name="simplified"></a><span class="type">QByteArray</span> QByteArray::<span class="name">simplified</span> () const</h3>
<p>Returns a byte array that has whitespace removed from the start and the end, and which has each sequence of internal whitespace replaced with a single space.</p>
<p>Whitespace means any character for which the standard C++ isspace() function returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;  lots\t of\nwhitespace\r\n &quot;</span>);
 ba <span class="operator">=</span> ba<span class="operator">.</span>simplified();
 <span class="comment">// ba == &quot;lots of whitespace&quot;;</span></pre>
<p><b>See also </b><a href="qbytearray.html#trimmed">trimmed</a>().</p>
<!-- @@@simplified -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type">int</span> QByteArray::<span class="name">size</span> () const</h3>
<p>Returns the number of bytes in this byte array.</p>
<p>The last byte in the byte array is at position size() - 1. In addition, <a href="qbytearray.html">QByteArray</a> ensures that the byte at position size() is always '\0', so that you can use the return value of <a href="qbytearray.html#data">data</a>() and <a href="qbytearray.html#constData">constData</a>() as arguments to functions that expect '\0'-terminated strings. If the <a href="qbytearray.html">QByteArray</a> object was created from a <a href="qbytearray.html#fromRawData">raw data</a> that didn't include the trailing null-termination character then <a href="qbytearray.html">QByteArray</a> doesn't add it automaticall unless the <a href="implicit-sharing.html#deep-copy">deep copy</a> is created.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;Hello&quot;</span>);
 <span class="type">int</span> n <span class="operator">=</span> ba<span class="operator">.</span>size();          <span class="comment">// n == 5</span>
 ba<span class="operator">.</span>data()<span class="operator">[</span><span class="number">0</span><span class="operator">]</span>;               <span class="comment">// returns 'H'</span>
 ba<span class="operator">.</span>data()<span class="operator">[</span><span class="number">4</span><span class="operator">]</span>;               <span class="comment">// returns 'o'</span>
 ba<span class="operator">.</span>data()<span class="operator">[</span><span class="number">5</span><span class="operator">]</span>;               <span class="comment">// returns '\0'</span></pre>
<p><b>See also </b><a href="qbytearray.html#isEmpty">isEmpty</a>() and <a href="qbytearray.html#resize">resize</a>().</p>
<!-- @@@size -->
<!-- $$$split[overload1]$$$splitchar -->
<h3 class="fn"><a name="split"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type">QByteArray</span>&gt; QByteArray::<span class="name">split</span> ( <span class="type">char</span> <i>sep</i> ) const</h3>
<p>Splits the byte array into subarrays wherever <i>sep</i> occurs, and returns the list of those arrays. If <i>sep</i> does not match anywhere in the byte array, split() returns a single-element list containing this byte array.</p>
<!-- @@@split -->
<!-- $$$squeeze[overload1]$$$squeeze -->
<h3 class="fn"><a name="squeeze"></a><span class="type">void</span> QByteArray::<span class="name">squeeze</span> ()</h3>
<p>Releases any memory not required to store the array's data.</p>
<p>The sole purpose of this function is to provide a means of fine tuning <a href="qbytearray.html">QByteArray</a>'s memory usage. In general, you will rarely ever need to call this function.</p>
<p><b>See also </b><a href="qbytearray.html#reserve">reserve</a>() and <a href="qbytearray.html#capacity">capacity</a>().</p>
<!-- @@@squeeze -->
<!-- $$$startsWith[overload1]$$$startsWithconstQByteArray& -->
<h3 class="fn"><a name="startsWith"></a><span class="type">bool</span> QByteArray::<span class="name">startsWith</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i> ) const</h3>
<p>Returns true if this byte array starts with byte array <i>ba</i>; otherwise returns false.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> url(<span class="string">&quot;ftp://ftp.qt.nokia.com/&quot;</span>);
 <span class="keyword">if</span> (url<span class="operator">.</span>startsWith(<span class="string">&quot;ftp:&quot;</span>))
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span></pre>
<p><b>See also </b><a href="qbytearray.html#endsWith">endsWith</a>() and <a href="qbytearray.html#left">left</a>().</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithconstchar* -->
<h3 class="fn"><a name="startsWith-2"></a><span class="type">bool</span> QByteArray::<span class="name">startsWith</span> ( const <span class="type">char</span> * <i>str</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if this byte array starts with string <i>str</i>; otherwise returns false.</p>
<!-- @@@startsWith -->
<!-- $$$startsWith$$$startsWithchar -->
<h3 class="fn"><a name="startsWith-3"></a><span class="type">bool</span> QByteArray::<span class="name">startsWith</span> ( <span class="type">char</span> <i>ch</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if this byte array starts with character <i>ch</i>; otherwise returns false.</p>
<!-- @@@startsWith -->
<!-- $$$swap[overload1]$$$swapQByteArray& -->
<h3 class="fn"><a name="swap"></a><span class="type">void</span> QByteArray::<span class="name">swap</span> ( <span class="type">QByteArray</span> &amp; <i>other</i> )</h3>
<p>Swaps byte array <i>other</i> with this byte array. This operation is very fast and never fails.</p>
<p>This function was introduced in Qt 4.8.</p>
<!-- @@@swap -->
<!-- $$$toBase64[overload1]$$$toBase64 -->
<h3 class="fn"><a name="toBase64"></a><span class="type">QByteArray</span> QByteArray::<span class="name">toBase64</span> () const</h3>
<p>Returns a copy of the byte array, encoded as Base64.</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> text(<span class="string">&quot;Qt is great!&quot;</span>);
 text<span class="operator">.</span>toBase64();        <span class="comment">// returns &quot;UXQgaXMgZ3JlYXQh&quot;</span></pre>
<p>The algorithm used to encode Base64-encoded data is defined in <a href="http://www.rfc-editor.org/rfc/rfc2045.txt">RFC 2045</a>.</p>
<p><b>See also </b><a href="qbytearray.html#fromBase64">fromBase64</a>().</p>
<!-- @@@toBase64 -->
<!-- $$$toDouble[overload1]$$$toDoublebool* -->
<h3 class="fn"><a name="toDouble"></a><span class="type">double</span> QByteArray::<span class="name">toDouble</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3>
<p>Returns the byte array converted to a <tt>double</tt> value.</p>
<p>Returns 0.0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> string(<span class="string">&quot;1234.56&quot;</span>);
 <span class="type">double</span> a <span class="operator">=</span> string<span class="operator">.</span>toDouble();   <span class="comment">// a == 1234.56</span></pre>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toDouble -->
<!-- $$$toFloat[overload1]$$$toFloatbool* -->
<h3 class="fn"><a name="toFloat"></a><span class="type">float</span> QByteArray::<span class="name">toFloat</span> ( <span class="type">bool</span> * <i>ok</i> = 0 ) const</h3>
<p>Returns the byte array converted to a <tt>float</tt> value.</p>
<p>Returns 0.0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toFloat -->
<!-- $$$toHex[overload1]$$$toHex -->
<h3 class="fn"><a name="toHex"></a><span class="type">QByteArray</span> QByteArray::<span class="name">toHex</span> () const</h3>
<p>Returns a hex encoded copy of the byte array. The hex encoding uses the numbers 0-9 and the letters a-f.</p>
<p><b>See also </b><a href="qbytearray.html#fromHex">fromHex</a>().</p>
<!-- @@@toHex -->
<!-- $$$toInt[overload1]$$$toIntbool*int -->
<h3 class="fn"><a name="toInt"></a><span class="type">int</span> QByteArray::<span class="name">toInt</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to an <tt>int</tt> using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> str(<span class="string">&quot;FF&quot;</span>);
 <span class="type">bool</span> ok;
 <span class="type">int</span> hex <span class="operator">=</span> str<span class="operator">.</span>toInt(<span class="operator">&amp;</span>ok<span class="operator">,</span> <span class="number">16</span>);     <span class="comment">// hex == 255, ok == true</span>
 <span class="type">int</span> dec <span class="operator">=</span> str<span class="operator">.</span>toInt(<span class="operator">&amp;</span>ok<span class="operator">,</span> <span class="number">10</span>);     <span class="comment">// dec == 0, ok == false</span></pre>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toInt -->
<!-- $$$toLong[overload1]$$$toLongbool*int -->
<h3 class="fn"><a name="toLong"></a><span class="type">long</span> QByteArray::<span class="name">toLong</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to a <tt>long</tt> int using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> str(<span class="string">&quot;FF&quot;</span>);
 <span class="type">bool</span> ok;
 <span class="type">long</span> hex <span class="operator">=</span> str<span class="operator">.</span>toLong(<span class="operator">&amp;</span>ok<span class="operator">,</span> <span class="number">16</span>);   <span class="comment">// hex == 255, ok == true</span>
 <span class="type">long</span> dec <span class="operator">=</span> str<span class="operator">.</span>toLong(<span class="operator">&amp;</span>ok<span class="operator">,</span> <span class="number">10</span>);   <span class="comment">// dec == 0, ok == false</span></pre>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toLong -->
<!-- $$$toLongLong[overload1]$$$toLongLongbool*int -->
<h3 class="fn"><a name="toLongLong"></a><span class="type"><a href="qtglobal.html#qlonglong-typedef">qlonglong</a></span> QByteArray::<span class="name">toLongLong</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to a <tt>long long</tt> using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toLongLong -->
<!-- $$$toLower[overload1]$$$toLower -->
<h3 class="fn"><a name="toLower"></a><span class="type">QByteArray</span> QByteArray::<span class="name">toLower</span> () const</h3>
<p>Returns a lowercase copy of the byte array. The bytearray is interpreted as a Latin-1 encoded string.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;Qt by NOKIA&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y <span class="operator">=</span> x<span class="operator">.</span>toLower();
 <span class="comment">// y == &quot;qt by nokia&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#toUpper">toUpper</a>() and <a href="qbytearray.html#8-bit-character-comparisons">8-bit Character Comparisons</a>.</p>
<!-- @@@toLower -->
<!-- $$$toPercentEncoding[overload1]$$$toPercentEncodingconstQByteArray&constQByteArray&char -->
<h3 class="fn"><a name="toPercentEncoding"></a><span class="type">QByteArray</span> QByteArray::<span class="name">toPercentEncoding</span> ( const <span class="type">QByteArray</span> &amp; <i>exclude</i> = QByteArray(), const <span class="type">QByteArray</span> &amp; <i>include</i> = QByteArray(), <span class="type">char</span> <i>percent</i> = '%' ) const</h3>
<p>Returns a URI/URL-style percent-encoded copy of this byte array. The <i>percent</i> parameter allows you to override the default '%' character for another.</p>
<p>By default, this function will encode all characters that are not one of the following:</p>
<p>ALPHA (&quot;a&quot; to &quot;z&quot; and &quot;A&quot; to &quot;Z&quot;) / DIGIT (0 to 9) / &quot;-&quot; / &quot;.&quot; / &quot;<a href="index.html">_</a>&quot; / &quot;~&quot;</p>
<p>To prevent characters from being encoded pass them to <i>exclude</i>. To force characters to be encoded pass them to <i>include</i>. The <i>percent</i> character is always encoded.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> text <span class="operator">=</span> <span class="string">&quot;{a fishy string?}&quot;</span>;
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba <span class="operator">=</span> text<span class="operator">.</span>toPercentEncoding(<span class="string">&quot;{}&quot;</span><span class="operator">,</span> <span class="string">&quot;s&quot;</span>);
 <a href="qtglobal.html#qDebug">qDebug</a>(ba<span class="operator">.</span>constData());
 <span class="comment">// prints &quot;{a fi%73hy %73tring%3F}&quot;</span></pre>
<p>The hex encoding uses the numbers 0-9 and the uppercase letters A-F.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qbytearray.html#fromPercentEncoding">fromPercentEncoding</a>() and <a href="qurl.html#toPercentEncoding">QUrl::toPercentEncoding</a>().</p>
<!-- @@@toPercentEncoding -->
<!-- $$$toShort[overload1]$$$toShortbool*int -->
<h3 class="fn"><a name="toShort"></a><span class="type">short</span> QByteArray::<span class="name">toShort</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to a <tt>short</tt> using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toShort -->
<!-- $$$toUInt[overload1]$$$toUIntbool*int -->
<h3 class="fn"><a name="toUInt"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> QByteArray::<span class="name">toUInt</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to an <tt>unsigned int</tt> using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toUInt -->
<!-- $$$toULong[overload1]$$$toULongbool*int -->
<h3 class="fn"><a name="toULong"></a><span class="type"><a href="qtglobal.html#ulong-typedef">ulong</a></span> QByteArray::<span class="name">toULong</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to an <tt>unsigned long int</tt> using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toULong -->
<!-- $$$toULongLong[overload1]$$$toULongLongbool*int -->
<h3 class="fn"><a name="toULongLong"></a><span class="type"><a href="qtglobal.html#qulonglong-typedef">qulonglong</a></span> QByteArray::<span class="name">toULongLong</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to an <tt>unsigned long long</tt> using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toULongLong -->
<!-- $$$toUShort[overload1]$$$toUShortbool*int -->
<h3 class="fn"><a name="toUShort"></a><span class="type"><a href="qtglobal.html#ushort-typedef">ushort</a></span> QByteArray::<span class="name">toUShort</span> ( <span class="type">bool</span> * <i>ok</i> = 0, <span class="type">int</span> <i>base</i> = 10 ) const</h3>
<p>Returns the byte array converted to an <tt>unsigned short</tt> using base <i>base</i>, which is 10 by default and must be between 2 and 36, or 0.</p>
<p>If <i>base</i> is 0, the base is determined automatically using the following rules: If the byte array begins with &quot;0x&quot;, it is assumed to be hexadecimal; if it begins with &quot;0&quot;, it is assumed to be octal; otherwise it is assumed to be decimal.</p>
<p>Returns 0 if the conversion fails.</p>
<p>If <i>ok</i> is not 0: if a conversion error occurs, *<i>ok</i> is set to false; otherwise *<i>ok</i> is set to true.</p>
<p><b>Note:</b> The conversion of the number is performed in the default C locale, irrespective of the user's locale.</p>
<p><b>See also </b><a href="qbytearray.html#number">number</a>().</p>
<!-- @@@toUShort -->
<!-- $$$toUpper[overload1]$$$toUpper -->
<h3 class="fn"><a name="toUpper"></a><span class="type">QByteArray</span> QByteArray::<span class="name">toUpper</span> () const</h3>
<p>Returns an uppercase copy of the byte array. The bytearray is interpreted as a Latin-1 encoded string.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;Qt by NOKIA&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y <span class="operator">=</span> x<span class="operator">.</span>toUpper();
 <span class="comment">// y == &quot;QT BY NOKIA&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#toLower">toLower</a>() and <a href="qbytearray.html#8-bit-character-comparisons">8-bit Character Comparisons</a>.</p>
<!-- @@@toUpper -->
<!-- $$$trimmed[overload1]$$$trimmed -->
<h3 class="fn"><a name="trimmed"></a><span class="type">QByteArray</span> QByteArray::<span class="name">trimmed</span> () const</h3>
<p>Returns a byte array that has whitespace removed from the start and the end.</p>
<p>Whitespace means any character for which the standard C++ isspace() function returns true. This includes the ASCII characters '\t', '\n', '\v', '\f', '\r', and ' '.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;  lots\t of\nwhitespace\r\n &quot;</span>);
 ba <span class="operator">=</span> ba<span class="operator">.</span>trimmed();
 <span class="comment">// ba == &quot;lots\t of\nwhitespace&quot;;</span></pre>
<p>Unlike <a href="qbytearray.html#simplified">simplified</a>(), trimmed() leaves internal whitespace alone.</p>
<p><b>See also </b><a href="qbytearray.html#simplified">simplified</a>().</p>
<!-- @@@trimmed -->
<!-- $$$truncate[overload1]$$$truncateint -->
<h3 class="fn"><a name="truncate"></a><span class="type">void</span> QByteArray::<span class="name">truncate</span> ( <span class="type">int</span> <i>pos</i> )</h3>
<p>Truncates the byte array at index position <i>pos</i>.</p>
<p>If <i>pos</i> is beyond the end of the array, nothing happens.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba(<span class="string">&quot;Stockholm&quot;</span>);
 ba<span class="operator">.</span>truncate(<span class="number">5</span>);             <span class="comment">// ba == &quot;Stock&quot;</span></pre>
<p><b>See also </b><a href="qbytearray.html#chop">chop</a>(), <a href="qbytearray.html#resize">resize</a>(), and <a href="qbytearray.html#left">left</a>().</p>
<!-- @@@truncate -->
<!-- $$$operator const char *[overload1]$$$operator const char * -->
<h3 class="fn"><a name="operator-const-char--2a"></a>QByteArray::<span class="name">operator const char *</span> () const</h3>
<p>Returns a pointer to the data stored in the byte array. The pointer can be used to access the bytes that compose the array. The data is '\0'-terminated. The pointer remains valid as long as the array isn't reallocated or destroyed.</p>
<p>This operator is mostly useful to pass a byte array to a function that accepts a <tt>const char *</tt>.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_BYTEARRAY</tt> when you compile your applications.</p>
<p>Note: A <a href="qbytearray.html">QByteArray</a> can store any byte values including '\0's, but most functions that take <tt>char *</tt> arguments assume that the data ends at the first '\0' they encounter.</p>
<p><b>See also </b><a href="qbytearray.html#constData">constData</a>().</p>
<!-- @@@operator const char * -->
<!-- $$$operator const void *[overload1]$$$operator const void * -->
<h3 class="fn"><a name="operator-const-void--2a"></a>QByteArray::<span class="name">operator const void *</span> () const</h3>
<p>Returns a pointer to the data stored in the byte array. The pointer can be used to access the bytes that compose the array. The data is '\0'-terminated. The pointer remains valid as long as the array isn't reallocated or destroyed.</p>
<p>This operator is mostly useful to pass a byte array to a function that accepts a <tt>const char *</tt>.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_BYTEARRAY</tt> when you compile your applications.</p>
<p>Note: A <a href="qbytearray.html">QByteArray</a> can store any byte values including '\0's, but most functions that take <tt>char *</tt> arguments assume that the data ends at the first '\0' they encounter.</p>
<p><b>See also </b><a href="qbytearray.html#constData">constData</a>().</p>
<!-- @@@operator const void * -->
<!-- $$$operator!=[overload1]$$$operator!=constQString& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QByteArray::<span class="name">operator!=</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> ) const</h3>
<p>Returns true if this byte array is not equal to string <i>str</i>; otherwise returns false.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>The comparison is case sensitive.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#fromAscii">QString::fromAscii</a>(), <a href="qstring.html#fromLatin1">QString::fromLatin1</a>(), <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(), or <a href="qstring.html#fromLocal8Bit">QString::fromLocal8Bit</a>() explicitly if you want to convert the byte array to a <a href="qstring.html">QString</a> before doing the comparison.</p>
<!-- @@@operator!= -->
<!-- $$$operator+=[overload1]$$$operator+=constQByteArray& -->
<h3 class="fn"><a name="operator-2b-eq"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">operator+=</span> ( const <span class="type">QByteArray</span> &amp; <i>ba</i> )</h3>
<p>Appends the byte array <i>ba</i> onto the end of this byte array and returns a reference to this byte array.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> x(<span class="string">&quot;free&quot;</span>);
 <span class="type"><a href="qbytearray.html">QByteArray</a></span> y(<span class="string">&quot;dom&quot;</span>);
 x <span class="operator">+</span><span class="operator">=</span> y;
 <span class="comment">// x == &quot;freedom&quot;</span></pre>
<p>Note: <a href="qbytearray.html">QByteArray</a> is an <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a> class. Consequently, if <i>this</i> is an empty <a href="qbytearray.html">QByteArray</a>, then <i>this</i> will just share the data held in <i>ba</i>. In this case, no copying of data is done, taking <a href="containers.html#constant-time">constant time</a>. If a shared instance is modified, it will be copied (copy-on-write), taking <a href="containers.html#linear-time">linear time</a>.</p>
<p>If <i>this</i> is not an empty <a href="qbytearray.html">QByteArray</a>, a deep copy of the data is performed, taking <a href="containers.html#linear-time">linear time</a>.</p>
<p>This operation typically does not suffer from allocation overhead, because <a href="qbytearray.html">QByteArray</a> preallocates extra space at the end of the data so that it may grow without reallocating for each append operation.</p>
<p><b>See also </b><a href="qbytearray.html#append">append</a>() and <a href="qbytearray.html#prepend">prepend</a>().</p>
<!-- @@@operator+= -->
<!-- $$$operator+=$$$operator+=constQString& -->
<h3 class="fn"><a name="operator-2b-eq-2"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">operator+=</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the string <i>str</i> onto the end of this byte array and returns a reference to this byte array. The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>If the <a href="qstring.html">QString</a> contains non-ASCII Unicode characters, using this operator can lead to loss of information. You can disable this operator by defining <tt>QT_NO_CAST_TO_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#toAscii">QString::toAscii</a>() (or <a href="qstring.html#toLatin1">QString::toLatin1</a>() or <a href="qstring.html#toUtf8">QString::toUtf8</a>() or <a href="qstring.html#toLocal8Bit">QString::toLocal8Bit</a>()) explicitly if you want to convert the data to <tt>const char *</tt>.</p>
<!-- @@@operator+= -->
<!-- $$$operator+=$$$operator+=constchar* -->
<h3 class="fn"><a name="operator-2b-eq-3"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">operator+=</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the string <i>str</i> onto the end of this byte array and returns a reference to this byte array.</p>
<!-- @@@operator+= -->
<!-- $$$operator+=$$$operator+=char -->
<h3 class="fn"><a name="operator-2b-eq-4"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">operator+=</span> ( <span class="type">char</span> <i>ch</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the character <i>ch</i> onto the end of this byte array and returns a reference to this byte array.</p>
<!-- @@@operator+= -->
<!-- $$$operator<[overload1]$$$operator<constQString& -->
<h3 class="fn"><a name="operator-lt"></a><span class="type">bool</span> QByteArray::<span class="name">operator&lt;</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> ) const</h3>
<p>Returns true if this byte array is lexically less than string <i>str</i>; otherwise returns false.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>The comparison is case sensitive.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#fromAscii">QString::fromAscii</a>(), <a href="qstring.html#fromLatin1">QString::fromLatin1</a>(), <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(), or <a href="qstring.html#fromLocal8Bit">QString::fromLocal8Bit</a>() explicitly if you want to convert the byte array to a <a href="qstring.html">QString</a> before doing the comparison.</p>
<!-- @@@operator< -->
<!-- $$$operator<=[overload1]$$$operator<=constQString& -->
<h3 class="fn"><a name="operator-lt-eq"></a><span class="type">bool</span> QByteArray::<span class="name">operator&lt;=</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> ) const</h3>
<p>Returns true if this byte array is lexically less than or equal to string <i>str</i>; otherwise returns false.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>The comparison is case sensitive.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#fromAscii">QString::fromAscii</a>(), <a href="qstring.html#fromLatin1">QString::fromLatin1</a>(), <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(), or <a href="qstring.html#fromLocal8Bit">QString::fromLocal8Bit</a>() explicitly if you want to convert the byte array to a <a href="qstring.html">QString</a> before doing the comparison.</p>
<!-- @@@operator<= -->
<!-- $$$operator=[overload1]$$$operator=constQByteArray& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">operator=</span> ( const <span class="type">QByteArray</span> &amp; <i>other</i> )</h3>
<p>Assigns <i>other</i> to this byte array and returns a reference to this byte array.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constchar* -->
<h3 class="fn"><a name="operator-eq-2"></a><span class="type">QByteArray</span> &amp; QByteArray::<span class="name">operator=</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>This is an overloaded function.</p>
<p>Assigns <i>str</i> to this byte array.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQString& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QByteArray::<span class="name">operator==</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> ) const</h3>
<p>Returns true if this byte array is equal to string <i>str</i>; otherwise returns false.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>The comparison is case sensitive.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#fromAscii">QString::fromAscii</a>(), <a href="qstring.html#fromLatin1">QString::fromLatin1</a>(), <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(), or <a href="qstring.html#fromLocal8Bit">QString::fromLocal8Bit</a>() explicitly if you want to convert the byte array to a <a href="qstring.html">QString</a> before doing the comparison.</p>
<!-- @@@operator== -->
<!-- $$$operator>[overload1]$$$operator>constQString& -->
<h3 class="fn"><a name="operator-gt"></a><span class="type">bool</span> QByteArray::<span class="name">operator&gt;</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> ) const</h3>
<p>Returns true if this byte array is lexically greater than string <i>str</i>; otherwise returns false.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>The comparison is case sensitive.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#fromAscii">QString::fromAscii</a>(), <a href="qstring.html#fromLatin1">QString::fromLatin1</a>(), <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(), or <a href="qstring.html#fromLocal8Bit">QString::fromLocal8Bit</a>() explicitly if you want to convert the byte array to a <a href="qstring.html">QString</a> before doing the comparison.</p>
<!-- @@@operator> -->
<!-- $$$operator>=[overload1]$$$operator>=constQString& -->
<h3 class="fn"><a name="operator-gt-eq"></a><span class="type">bool</span> QByteArray::<span class="name">operator&gt;=</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>str</i> ) const</h3>
<p>Returns true if this byte array is greater than or equal to string <i>str</i>; otherwise returns false.</p>
<p>The Unicode data is converted into 8-bit characters using <a href="qstring.html#toAscii">QString::toAscii</a>().</p>
<p>The comparison is case sensitive.</p>
<p>You can disable this operator by defining <tt>QT_NO_CAST_FROM_ASCII</tt> when you compile your applications. You then need to call <a href="qstring.html#fromAscii">QString::fromAscii</a>(), <a href="qstring.html#fromLatin1">QString::fromLatin1</a>(), <a href="qstring.html#fromUtf8">QString::fromUtf8</a>(), or <a href="qstring.html#fromLocal8Bit">QString::fromLocal8Bit</a>() explicitly if you want to convert the byte array to a <a href="qstring.html">QString</a> before doing the comparison.</p>
<!-- @@@operator>= -->
<!-- $$$operator[][overload1]$$$operator[]int -->
<h3 class="fn"><a name="operator-5b-5d"></a><span class="type">QByteRef</span> QByteArray::<span class="name">operator[]</span> ( <span class="type">int</span> <i>i</i> )</h3>
<p>Returns the byte at index position <i>i</i> as a modifiable reference.</p>
<p>If an assignment is made beyond the end of the byte array, the array is extended with <a href="qbytearray.html#resize">resize</a>() before the assignment takes place.</p>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qbytearray.html">QByteArray</a></span> ba;
 <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator">&lt;</span> <span class="number">10</span>; <span class="operator">+</span><span class="operator">+</span>i)
     ba<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">=</span> <span class="char">'A'</span> <span class="operator">+</span> i;
 <span class="comment">// ba == &quot;ABCDEFGHIJ&quot;</span></pre>
<p>The return value is of type QByteRef, a helper class for <a href="qbytearray.html">QByteArray</a>. When you get an object of type QByteRef, you can use it as if it were a char &amp;. If you assign to it, the assignment will apply to the character in the <a href="qbytearray.html">QByteArray</a> from which you got the reference.</p>
<p><b>See also </b><a href="qbytearray.html#at">at</a>().</p>
<!-- @@@operator[] -->
<!-- $$$operator[]$$$operator[]int -->
<h3 class="fn"><a name="operator-5b-5d-2"></a><span class="type">char</span> QByteArray::<span class="name">operator[]</span> ( <span class="type">int</span> <i>i</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Same as at(<i>i</i>).</p>
<!-- @@@operator[] -->
<!-- $$$operator[]$$$operator[]uint -->
<h3 class="fn"><a name="operator-5b-5d-3"></a><span class="type">QByteRef</span> QByteArray::<span class="name">operator[]</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>i</i> )</h3>
<p>This is an overloaded function.</p>
<!-- @@@operator[] -->
<!-- $$$operator[]$$$operator[]uint -->
<h3 class="fn"><a name="operator-5b-5d-4"></a><span class="type">char</span> QByteArray::<span class="name">operator[]</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>i</i> ) const</h3>
<p>This is an overloaded function.</p>
<!-- @@@operator[] -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qChecksum[overload1]$$$qChecksumconstchar*uint -->
<h3 class="fn"><a name="qChecksum"></a><span class="type"><a href="qtglobal.html#quint16-typedef">quint16</a></span> <span class="name">qChecksum</span> ( const <span class="type">char</span> * <i>data</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>len</i> )</h3>
<p>Returns the CRC-16 checksum of the first <i>len</i> bytes of <i>data</i>.</p>
<p>The checksum is independent of the byte order (endianness).</p>
<p><b>Note:</b> This function is a 16-bit cache conserving (16 entry table) implementation of the CRC-16-CCITT algorithm.</p>
<!-- @@@qChecksum -->
<!-- $$$qCompress[overload1]$$$qCompressconstQByteArray&int -->
<h3 class="fn"><a name="qCompress"></a><span class="type">QByteArray</span> <span class="name">qCompress</span> ( const <span class="type">QByteArray</span> &amp; <i>data</i>, <span class="type">int</span> <i>compressionLevel</i> = -1 )</h3>
<p>Compresses the <i>data</i> byte array and returns the compressed data in a new byte array.</p>
<p>The <i>compressionLevel</i> parameter specifies how much compression should be used. Valid values are between 0 and 9, with 9 corresponding to the greatest compression (i.e&#x2e; smaller compressed data) at the cost of using a slower algorithm. Smaller values (8, 7, ..&#x2e;, 1) provide successively less compression at slightly faster speeds. The value 0 corresponds to no compression at all. The default value is -1, which specifies zlib's default compression.</p>
<p><b>See also </b><a href="qbytearray.html#qUncompress">qUncompress</a>().</p>
<!-- @@@qCompress -->
<!-- $$$qCompress$$$qCompressconstuchar*intint -->
<h3 class="fn"><a name="qCompress-2"></a><span class="type">QByteArray</span> <span class="name">qCompress</span> ( const <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>data</i>, <span class="type">int</span> <i>nbytes</i>, <span class="type">int</span> <i>compressionLevel</i> = -1 )</h3>
<p>This is an overloaded function.</p>
<p>Compresses the first <i>nbytes</i> of <i>data</i> and returns the compressed data in a new byte array.</p>
<!-- @@@qCompress -->
<!-- $$$qUncompress[overload1]$$$qUncompressconstQByteArray& -->
<h3 class="fn"><a name="qUncompress"></a><span class="type">QByteArray</span> <span class="name">qUncompress</span> ( const <span class="type">QByteArray</span> &amp; <i>data</i> )</h3>
<p>Uncompresses the <i>data</i> byte array and returns a new byte array with the uncompressed data.</p>
<p>Returns an empty <a href="qbytearray.html">QByteArray</a> if the input data was corrupt.</p>
<p>This function will uncompress data compressed with <a href="qbytearray.html#qCompress">qCompress</a>() from this and any earlier Qt version, back to Qt 3.1 when this feature was added.</p>
<p><b>Note:</b> If you want to use this function to uncompress external data that was compressed using zlib, you first need to prepend a four byte header to the byte array containing the data. The header must contain the expected length (in bytes) of the uncompressed data, expressed as an unsigned, big-endian, 32-bit integer.</p>
<p><b>See also </b><a href="qbytearray.html#qCompress">qCompress</a>().</p>
<!-- @@@qUncompress -->
<!-- $$$qUncompress$$$qUncompressconstuchar*int -->
<h3 class="fn"><a name="qUncompress-2"></a><span class="type">QByteArray</span> <span class="name">qUncompress</span> ( const <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>data</i>, <span class="type">int</span> <i>nbytes</i> )</h3>
<p>This is an overloaded function.</p>
<p>Uncompresses the first <i>nbytes</i> of <i>data</i> and returns a new byte array with the uncompressed data.</p>
<!-- @@@qUncompress -->
<!-- $$$qsnprintf[overload1]$$$qsnprintfchar*size_tconstchar*... -->
<h3 class="fn"><a name="qsnprintf"></a><span class="type">int</span> <span class="name">qsnprintf</span> ( <span class="type">char</span> * <i>str</i>, <span class="type">size_t</span> <i>n</i>, const <span class="type">char</span> * <i>fmt</i>, ... )</h3>
<p>A portable snprintf() function, calls qvsnprintf.</p>
<p><i>fmt</i> is the <tt>printf()</tt> format string. The result is put into <i>str</i>, which is a buffer of at least <i>n</i> bytes.</p>
<p><b>Warning:</b> Call this function only when you know what you are doing since it shows different behavior on certain platforms. Use <a href="qstring.html#sprintf">QString::sprintf</a>() to format a string instead.</p>
<p><b>See also </b><a href="qbytearray.html#qvsnprintf">qvsnprintf</a>() and <a href="qstring.html#sprintf">QString::sprintf</a>().</p>
<!-- @@@qsnprintf -->
<!-- $$$qstrcmp[overload1]$$$qstrcmpconstchar*constchar* -->
<h3 class="fn"><a name="qstrcmp"></a><span class="type">int</span> <span class="name">qstrcmp</span> ( const <span class="type">char</span> * <i>str1</i>, const <span class="type">char</span> * <i>str2</i> )</h3>
<p>A safe <tt>strcmp()</tt> function.</p>
<p>Compares <i>str1</i> and <i>str2</i>. Returns a negative value if <i>str1</i> is less than <i>str2</i>, 0 if <i>str1</i> is equal to <i>str2</i> or a positive value if <i>str1</i> is greater than <i>str2</i>.</p>
<p>Special case 1: Returns 0 if <i>str1</i> and <i>str2</i> are both 0.</p>
<p>Special case 2: Returns an arbitrary non-zero value if <i>str1</i> is 0 or <i>str2</i> is 0 (but not both).</p>
<p><b>See also </b><a href="qbytearray.html#qstrncmp">qstrncmp</a>(), <a href="qbytearray.html#qstricmp">qstricmp</a>(), <a href="qbytearray.html#qstrnicmp">qstrnicmp</a>(), and <a href="qbytearray.html#8-bit-character-comparisons">8-bit Character Comparisons</a>.</p>
<!-- @@@qstrcmp -->
<!-- $$$qstrcpy[overload1]$$$qstrcpychar*constchar* -->
<h3 class="fn"><a name="qstrcpy"></a><span class="type">char</span> * <span class="name">qstrcpy</span> ( <span class="type">char</span> * <i>dst</i>, const <span class="type">char</span> * <i>src</i> )</h3>
<p>Copies all the characters up to and including the '\0' from <i>src</i> into <i>dst</i> and returns a pointer to <i>dst</i>. If <i>src</i> is 0, it immediately returns 0.</p>
<p>This function assumes that <i>dst</i> is large enough to hold the contents of <i>src</i>.</p>
<p><b>See also </b><a href="qbytearray.html#qstrncpy">qstrncpy</a>().</p>
<!-- @@@qstrcpy -->
<!-- $$$qstrdup[overload1]$$$qstrdupconstchar* -->
<h3 class="fn"><a name="qstrdup"></a><span class="type">char</span> * <span class="name">qstrdup</span> ( const <span class="type">char</span> * <i>src</i> )</h3>
<p>Returns a duplicate string.</p>
<p>Allocates space for a copy of <i>src</i>, copies it, and returns a pointer to the copy. If <i>src</i> is 0, it immediately returns 0.</p>
<p>Ownership is passed to the caller, so the returned string must be deleted using <tt>delete[]</tt>.</p>
<!-- @@@qstrdup -->
<!-- $$$qstricmp[overload1]$$$qstricmpconstchar*constchar* -->
<h3 class="fn"><a name="qstricmp"></a><span class="type">int</span> <span class="name">qstricmp</span> ( const <span class="type">char</span> * <i>str1</i>, const <span class="type">char</span> * <i>str2</i> )</h3>
<p>A safe <tt>stricmp()</tt> function.</p>
<p>Compares <i>str1</i> and <i>str2</i> ignoring the case of the characters. The encoding of the strings is assumed to be Latin-1.</p>
<p>Returns a negative value if <i>str1</i> is less than <i>str2</i>, 0 if <i>str1</i> is equal to <i>str2</i> or a positive value if <i>str1</i> is greater than <i>str2</i>.</p>
<p>Special case 1: Returns 0 if <i>str1</i> and <i>str2</i> are both 0.</p>
<p>Special case 2: Returns a random non-zero value if <i>str1</i> is 0 or <i>str2</i> is 0 (but not both).</p>
<p><b>See also </b><a href="qbytearray.html#qstrcmp">qstrcmp</a>(), <a href="qbytearray.html#qstrncmp">qstrncmp</a>(), <a href="qbytearray.html#qstrnicmp">qstrnicmp</a>(), and <a href="qbytearray.html#8-bit-character-comparisons">8-bit Character Comparisons</a>.</p>
<!-- @@@qstricmp -->
<!-- $$$qstrlen[overload1]$$$qstrlenconstchar* -->
<h3 class="fn"><a name="qstrlen"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <span class="name">qstrlen</span> ( const <span class="type">char</span> * <i>str</i> )</h3>
<p>A safe <tt>strlen()</tt> function.</p>
<p>Returns the number of characters that precede the terminating '\0', or 0 if <i>str</i> is 0.</p>
<p><b>See also </b><a href="qbytearray.html#qstrnlen">qstrnlen</a>().</p>
<!-- @@@qstrlen -->
<!-- $$$qstrncmp[overload1]$$$qstrncmpconstchar*constchar*uint -->
<h3 class="fn"><a name="qstrncmp"></a><span class="type">int</span> <span class="name">qstrncmp</span> ( const <span class="type">char</span> * <i>str1</i>, const <span class="type">char</span> * <i>str2</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>len</i> )</h3>
<p>A safe <tt>strncmp()</tt> function.</p>
<p>Compares at most <i>len</i> bytes of <i>str1</i> and <i>str2</i>.</p>
<p>Returns a negative value if <i>str1</i> is less than <i>str2</i>, 0 if <i>str1</i> is equal to <i>str2</i> or a positive value if <i>str1</i> is greater than <i>str2</i>.</p>
<p>Special case 1: Returns 0 if <i>str1</i> and <i>str2</i> are both 0.</p>
<p>Special case 2: Returns a random non-zero value if <i>str1</i> is 0 or <i>str2</i> is 0 (but not both).</p>
<p><b>See also </b><a href="qbytearray.html#qstrcmp">qstrcmp</a>(), <a href="qbytearray.html#qstricmp">qstricmp</a>(), <a href="qbytearray.html#qstrnicmp">qstrnicmp</a>(), and <a href="qbytearray.html#8-bit-character-comparisons">8-bit Character Comparisons</a>.</p>
<!-- @@@qstrncmp -->
<!-- $$$qstrncpy[overload1]$$$qstrncpychar*constchar*uint -->
<h3 class="fn"><a name="qstrncpy"></a><span class="type">char</span> * <span class="name">qstrncpy</span> ( <span class="type">char</span> * <i>dst</i>, const <span class="type">char</span> * <i>src</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>len</i> )</h3>
<p>A safe <tt>strncpy()</tt> function.</p>
<p>Copies at most <i>len</i> bytes from <i>src</i> (stopping at <i>len</i> or the terminating '\0' whichever comes first) into <i>dst</i> and returns a pointer to <i>dst</i>. Guarantees that <i>dst</i> is '\0'-terminated. If <i>src</i> or <i>dst</i> is 0, returns 0 immediately.</p>
<p>This function assumes that <i>dst</i> is at least <i>len</i> characters long.</p>
<p><b>Note:</b> When compiling with Visual C++ compiler version 14.00 (Visual C++ 2005) or later, internally the function strncpy_s will be used.</p>
<p><b>See also </b><a href="qbytearray.html#qstrcpy">qstrcpy</a>().</p>
<!-- @@@qstrncpy -->
<!-- $$$qstrnicmp[overload1]$$$qstrnicmpconstchar*constchar*uint -->
<h3 class="fn"><a name="qstrnicmp"></a><span class="type">int</span> <span class="name">qstrnicmp</span> ( const <span class="type">char</span> * <i>str1</i>, const <span class="type">char</span> * <i>str2</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>len</i> )</h3>
<p>A safe <tt>strnicmp()</tt> function.</p>
<p>Compares at most <i>len</i> bytes of <i>str1</i> and <i>str2</i> ignoring the case of the characters. The encoding of the strings is assumed to be Latin-1.</p>
<p>Returns a negative value if <i>str1</i> is less than <i>str2</i>, 0 if <i>str1</i> is equal to <i>str2</i> or a positive value if <i>str1</i> is greater than <i>str2</i>.</p>
<p>Special case 1: Returns 0 if <i>str1</i> and <i>str2</i> are both 0.</p>
<p>Special case 2: Returns a random non-zero value if <i>str1</i> is 0 or <i>str2</i> is 0 (but not both).</p>
<p><b>See also </b><a href="qbytearray.html#qstrcmp">qstrcmp</a>(), <a href="qbytearray.html#qstrncmp">qstrncmp</a>(), <a href="qbytearray.html#qstricmp">qstricmp</a>(), and <a href="qbytearray.html#8-bit-character-comparisons">8-bit Character Comparisons</a>.</p>
<!-- @@@qstrnicmp -->
<!-- $$$qstrnlen[overload1]$$$qstrnlenconstchar*uint -->
<h3 class="fn"><a name="qstrnlen"></a><span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <span class="name">qstrnlen</span> ( const <span class="type">char</span> * <i>str</i>, <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>maxlen</i> )</h3>
<p>A safe <tt>strnlen()</tt> function.</p>
<p>Returns the number of characters that precede the terminating '\0', but at most <i>maxlen</i>. If <i>str</i> is 0, returns 0.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qbytearray.html#qstrlen">qstrlen</a>().</p>
<!-- @@@qstrnlen -->
<!-- $$$qvsnprintf[overload1]$$$qvsnprintfchar*size_tconstchar*va_list -->
<h3 class="fn"><a name="qvsnprintf"></a><span class="type">int</span> <span class="name">qvsnprintf</span> ( <span class="type">char</span> * <i>str</i>, <span class="type">size_t</span> <i>n</i>, const <span class="type">char</span> * <i>fmt</i>, <span class="type">va_list</span> <i>ap</i> )</h3>
<p>A portable <tt>vsnprintf()</tt> function. Will call <tt>::vsnprintf()</tt>, <tt>::_vsnprintf()</tt>, or <tt>::vsnprintf_s</tt> depending on the system, or fall back to an internal version.</p>
<p><i>fmt</i> is the <tt>printf()</tt> format string. The result is put into <i>str</i>, which is a buffer of at least <i>n</i> bytes.</p>
<p>The caller is responsible to call <tt>va_end()</tt> on <i>ap</i>.</p>
<p><b>Warning:</b> Since vsnprintf() shows different behavior on certain platforms, you should not rely on the return value or on the fact that you will always get a 0 terminated string back.</p>
<p>Ideally, you should never call this function but use <a href="qstring.html#sprintf">QString::sprintf</a>() instead.</p>
<p><b>See also </b><a href="qbytearray.html#qsnprintf">qsnprintf</a>() and <a href="qstring.html#sprintf">QString::sprintf</a>().</p>
<!-- @@@qvsnprintf -->
<!-- $$$operator!=$$$operator!=constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="operator-not-eq-67"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is not equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator!=$$$operator!=constQByteArray&constchar* -->
<h3 class="fn"><a name="operator-not-eq-68"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">char</span> * <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is not equal to string <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator!=$$$operator!=constchar*constQByteArray& -->
<h3 class="fn"><a name="operator-not-eq-69"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">char</span> * <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if string <i>a1</i> is not equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator+$$$operator+constQByteArray&constchar* -->
<h3 class="fn"><a name="operator-2b-40"></a>const <span class="type">QByteArray</span> <span class="name">operator+</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">char</span> * <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns a byte array that is the result of concatenating byte array <i>a1</i> and string <i>a2</i>.</p>
<!-- @@@operator+ -->
<!-- $$$operator+$$$operator+constQByteArray&char -->
<h3 class="fn"><a name="operator-2b-41"></a>const <span class="type">QByteArray</span> <span class="name">operator+</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, <span class="type">char</span> <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns a byte array that is the result of concatenating byte array <i>a1</i> and character <i>a2</i>.</p>
<!-- @@@operator+ -->
<!-- $$$operator+$$$operator+constchar*constQByteArray& -->
<h3 class="fn"><a name="operator-2b-42"></a>const <span class="type">QByteArray</span> <span class="name">operator+</span> ( const <span class="type">char</span> * <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns a byte array that is the result of concatenating string <i>a1</i> and byte array <i>a2</i>.</p>
<!-- @@@operator+ -->
<!-- $$$operator+$$$operator+charconstQByteArray& -->
<h3 class="fn"><a name="operator-2b-43"></a>const <span class="type">QByteArray</span> <span class="name">operator+</span> ( <span class="type">char</span> <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns a byte array that is the result of concatenating character <i>a1</i> and byte array <i>a2</i>.</p>
<!-- @@@operator+ -->
<!-- $$$operator+$$$operator+constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="operator-2b-14"></a>const <span class="type">QByteArray</span> <span class="name">operator+</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>Returns a byte array that is the result of concatenating byte array <i>a1</i> and byte array <i>a2</i>.</p>
<p><b>See also </b><a href="qbytearray.html#operator-2b-eq">QByteArray::operator+=</a>().</p>
<!-- @@@operator+ -->
<!-- $$$operator<$$$operator<constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="operator-lt-19"></a><span class="type">bool</span> <span class="name">operator&lt;</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically less than byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator< -->
<!-- $$$operator<$$$operator<constQByteArray&constchar* -->
<h3 class="fn"><a name="operator-lt-20"></a><span class="type">bool</span> <span class="name">operator&lt;</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">char</span> * <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically less than string <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator< -->
<!-- $$$operator<$$$operator<constchar*constQByteArray& -->
<h3 class="fn"><a name="operator-lt-21"></a><span class="type">bool</span> <span class="name">operator&lt;</span> ( const <span class="type">char</span> * <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if string <i>a1</i> is lexically less than byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator< -->
<!-- $$$operator<<$$$operator<<QDataStream&constQByteArray& -->
<h3 class="fn"><a name="operator-lt-lt-49"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>out</i>, const <span class="type">QByteArray</span> &amp; <i>ba</i> )</h3>
<p>Writes byte array <i>ba</i> to the stream <i>out</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator<=$$$operator<=constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="operator-lt-eq-13"></a><span class="type">bool</span> <span class="name">operator&lt;=</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically less than or equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator<= -->
<!-- $$$operator<=$$$operator<=constQByteArray&constchar* -->
<h3 class="fn"><a name="operator-lt-eq-14"></a><span class="type">bool</span> <span class="name">operator&lt;=</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">char</span> * <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically less than or equal to string <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator<= -->
<!-- $$$operator<=$$$operator<=constchar*constQByteArray& -->
<h3 class="fn"><a name="operator-lt-eq-15"></a><span class="type">bool</span> <span class="name">operator&lt;=</span> ( const <span class="type">char</span> * <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if string <i>a1</i> is lexically less than or equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator<= -->
<!-- $$$operator==$$$operator==constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="operator-eq-eq-95"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator==$$$operator==constQByteArray&constchar* -->
<h3 class="fn"><a name="operator-eq-eq-96"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">char</span> * <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is equal to string <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator==$$$operator==constchar*constQByteArray& -->
<h3 class="fn"><a name="operator-eq-eq-97"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">char</span> * <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if string <i>a1</i> is equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator>$$$operator>constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="operator-gt-13"></a><span class="type">bool</span> <span class="name">operator&gt;</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically greater than byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator> -->
<!-- $$$operator>$$$operator>constQByteArray&constchar* -->
<h3 class="fn"><a name="operator-gt-14"></a><span class="type">bool</span> <span class="name">operator&gt;</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">char</span> * <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically greater than string <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator> -->
<!-- $$$operator>$$$operator>constchar*constQByteArray& -->
<h3 class="fn"><a name="operator-gt-15"></a><span class="type">bool</span> <span class="name">operator&gt;</span> ( const <span class="type">char</span> * <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if string <i>a1</i> is lexically greater than byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator> -->
<!-- $$$operator>=$$$operator>=constQByteArray&constQByteArray& -->
<h3 class="fn"><a name="operator-gt-eq-13"></a><span class="type">bool</span> <span class="name">operator&gt;=</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically greater than or equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator>= -->
<!-- $$$operator>=$$$operator>=constQByteArray&constchar* -->
<h3 class="fn"><a name="operator-gt-eq-14"></a><span class="type">bool</span> <span class="name">operator&gt;=</span> ( const <span class="type">QByteArray</span> &amp; <i>a1</i>, const <span class="type">char</span> * <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if byte array <i>a1</i> is lexically greater than or equal to string <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator>= -->
<!-- $$$operator>=$$$operator>=constchar*constQByteArray& -->
<h3 class="fn"><a name="operator-gt-eq-15"></a><span class="type">bool</span> <span class="name">operator&gt;=</span> ( const <span class="type">char</span> * <i>a1</i>, const <span class="type">QByteArray</span> &amp; <i>a2</i> )</h3>
<p>This is an overloaded function.</p>
<p>Returns true if string <i>a1</i> is lexically greater than or equal to byte array <i>a2</i>; otherwise returns false.</p>
<!-- @@@operator>= -->
<!-- $$$operator>>$$$operator>>QDataStream&QByteArray& -->
<h3 class="fn"><a name="operator-gt-gt-31"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>in</i>, <span class="type">QByteArray</span> &amp; <i>ba</i> )</h3>
<p>Reads a byte array into <i>ba</i> from the stream <i>in</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$QT_NO_CAST_FROM_BYTEARRAY[overload1]$$$QT_NO_CAST_FROM_BYTEARRAY -->
<h3 class="fn"><a name="QT_NO_CAST_FROM_BYTEARRAY"></a><span class="name">QT_NO_CAST_FROM_BYTEARRAY</span></h3>
<p>Disables automatic conversions from <a href="qbytearray.html">QByteArray</a> to const char * or const void *.</p>
<p><b>See also </b><a href="qstring.html#QT_NO_CAST_TO_ASCII">QT_NO_CAST_TO_ASCII</a> and <a href="qstring.html#QT_NO_CAST_FROM_ASCII">QT_NO_CAST_FROM_ASCII</a>.</p>
<!-- @@@QT_NO_CAST_FROM_BYTEARRAY -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>