1 package org.davidmoten.hilbert;
2
3 final class Util {
4
5 private Util() {
6 // prevent instantiation
7 }
8
9 // visible for testing
10 static void reverse(byte[] array) {
11 if (array == null) {
12 return;
13 }
14 int i = 0;
15 int j = array.length - 1;
16 byte tmp;
17 while (j > i) {
18 tmp = array[j];
19 array[j] = array[i];
20 array[i] = tmp;
21 j--;
22 i++;
23 }
24 }
25 }