code: public static int delta(int[] data, int start, int length, int init,
                  int[] out) {
                  for (int i = length - 1; i > 0; --i) {
                          out[i] = data[start + i] - data[start + i - 1];
                  }
                  out[0] = data[start] - init;
                  return data[start + length - 1];
          }
docs: Compute differential coding given an initial value. Output is written
  to a provided array: must have length "length" or better.
  
  @param data
  data to be modified
  @param start
  starting index
  @param length
  number of integers to process
  @param init
  initial value
  @param out
  output array
  @return next initial vale