hollow/src/main/java/com/netflix/hollow/core/memory/encoding/VarInt.java
public static int writeVInt(byte data[], int pos, int value) {
        if(value > 0x0FFFFFFF || value < 0) data[pos++] = ((byte)(0x80 | ((value >>> 28))));
        if(value > 0x1FFFFF || value < 0)   data[pos++] = ((byte)(0x80 | ((value >>> 21) & 0x7F)));
        if(value > 0x3FFF || value < 0)     data[pos++] = ((byte)(0x80 | ((value >>> 14) & 0x7F)));
        if(value > 0x7F || value < 0)       data[pos++] = ((byte)(0x80 | ((value >>>  7) & 0x7F)));
        
        data[pos++] = (byte)(value & 0x7F);
        
        return pos;
    }
public static int writeVInt(byte data[], int pos, int value) {
        if(value > 0x0FFFFFFF || value < 0) data[pos++] = ((byte)(0x80 | ((value >>> 28))));
        if(value > 0x1FFFFF || value < 0)   data[pos++] = ((byte)(0x80 | ((value >>> 21) & 0x7F)));
        if(value > 0x3FFF || value < 0)     data[pos++] = ((byte)(0x80 | ((value >>> 14) & 0x7F)));
        if(value > 0x7F || value < 0)       data[pos++] = ((byte)(0x80 | ((value >>>  7) & 0x7F)));
        
        data[pos++] = (byte)(value & 0x7F);
        
        return pos;
    }
public static int writeVInt ( byte data [ ] , int pos , int value ) { if ( value > 0x0FFFFFFF || value < 0 ) data [ pos ++ ] = ( ( byte ) ( 0x80 | ( ( value >>> 28 ) ) ) ) ; if ( value > 0x1FFFFF || value < 0 ) data [ pos ++ ] = ( ( byte ) ( 0x80 | ( ( value >>> 21 ) & 0x7F ) ) ) ; if ( value > 0x3FFF || value < 0 ) data [ pos ++ ] = ( ( byte ) ( 0x80 | ( ( value >>> 14 ) & 0x7F ) ) ) ; if ( value > 0x7F || value < 0 ) data [ pos ++ ] = ( ( byte ) ( 0x80 | ( ( value >>> 7 ) & 0x7F ) ) ) ; data [ pos ++ ] = ( byte ) ( value & 0x7F ) ; return pos ; }
Write the value as a VarInt into the array, starting at the specified position.

@param data the byte array to write to
@param pos the position in the byte array
@param value the int value
@return the next position after the VarInt has been written.
Write the value as a VarInt into the array starting at the specified position .