readVInt() has to return positive numbers (and zero), throw some exception in case of negative numbers.
While for the sequence of bytes [-1, -1, -1, -1, 15] it returns -1.
simplifying readVInt up to last readByte (exclusive):
Here i = 268435455 or in binary format is 00001111_11111111_11111111_11111111
Keeping in mind that int is a signed type we have only 3 more bits before overflow happens or in another words (Integer.MAX_VALUE - i) >> 28 == 7 - that's max value could be stored in 5th byte to avoid overflow.
has to be