code: public static byte[] getIndexArray(int length) {
          byte[] index = new byte[length];
          for (int i=0; i<index.length; i++) {
              index[i] = (byte) i;
          }
          return index;
      }
docs: Gets an array where array[i] = i.
  @param length The length of the array.
  @return The new index array.