code: private void closeValueLength(int value, int index) {
      int initialValue = toIntUnsigned(getValue(index));
      setLength(index, (short) (value - initialValue));
    }
docs: To set the last value of a value length