qsort(array, hi - span + 1, span);
qsort(array, hi - span, span);
  private static void qsort(byte[] array, int from, int count)  {    // Use an insertion sort on small arrays.    if (count <= 7)      {        for (int i = from + 1; i < from + count; i++)          for (int j = i; j > 0 && array[j - 1] > array[j]; j--)            swap(j, j - 1, array);        return;      }    // Determine a good median element.    int mid = count / 2;    int lo = from;    int hi = from + count - 1;    if (count > 40)      { // big arrays, pseudomedian of 9        int s = count / 8;        lo = med3(lo, lo + s, lo + s + s, array);        mid = med3(mid - s, mid, mid + s, array);        hi = med3(hi - s - s, hi - s, hi, array);      }    mid = med3(lo, mid, hi, array);    int a, b, c, d;    int comp;    // Pull the median element out of the fray, and use it as a pivot.    swap(from, mid, array);    a = b = from + 1;    c = d = hi;    // Repeatedly move b and c to each other, swapping elements so    // that all elements before index b are less than the pivot, and all    // elements after index c are greater than the pivot. a and b track    // the elements equal to the pivot.    while (true)      {        while (b <= c && (comp = array[b] - array[from]) <= 0)          {            if (comp == 0)              {                swap(a, b, array);                a++;              }            b++;          }        while (c >= b && (comp = array[c] - array[from]) >= 0)          {            if (comp == 0)              {                swap(c, d, array);                d--;              }            c--;          }        if (b > c)          break;        swap(b, c, array);        b++;        c--;      }    // Swap pivot(s) back in place, the recurse on left and right sections.    int span;    span = Math.min(a - from, b - a);    vecswap(from, b - span, span, array);    span = Math.min(d - c, hi - d - 1);    vecswap(b, hi - span + 1, span, array);    span = b - a;    if (span > 1)      qsort(array, from, span);    span = d - c;    if (span > 1)      qsort(array, hi - span + 1, span);  }