title: Sorting algorithm of Arrays in Java.util package
body: <pre><code> /**
   * Sorts the specified sub-array of bytes into ascending order.
   */
  private static void sort1(byte x[], int off, int len) {
  // Insertion sort on smallest arrays
  if (len &lt; 7) {
      for (int i=off; i&lt;len+off; i++)
      for (int j=i; j&gt;off &amp;&amp; x[j-1]&gt;x[j]; j--)
          swap(x, j, j-1);
      return;
  }
  </code></pre>
  
  <blockquote>
    <p>From Arrays.java line 804-814</p>
  </blockquote>
  
  <p>As quoted above, it's claiming of using Insertion Sort.
  However, I'm taking it as Bubble Sort?
  Which one it's actually is, and why?</p>