docs: public static byte[] copyRange(byte[] orig, int from, int to) {
      int length = to - from;
      byte[] result = new byte[length];
      int howMuchToCopy = orig.length - from < length ? orig.length - from : length;
      System.arraycopy(orig, from, result, 0, howMuchToCopy);
      return result;
    }