code: public static void reverse (byte[] values, int offset, int length)
      {
          int aidx = offset;
          int bidx = offset + length - 1;
          while (bidx > aidx) {
              byte value = values[aidx];
              values[aidx] = values[bidx];
              values[bidx] = value;
              aidx++;
              bidx--;
          }
      }
docs: Reverses a subset of elements within the specified array.
  
  @param values the array containing elements to reverse.
  @param offset the index at which to start reversing elements.
  @param length the number of elements to reverse.