private int[] varintencode(int value) {
		int count = 1;
		for(int i = 3 ; i >= 1 ; i--) {
			if(((value)&(127<<(7*i))) != 0) {
				count = i + 1;
				break;
			}
		}
		
		int[] ret = new int[count];
		
		for(int i = 0 ; i < count ; i++) {
			int hasNext = 0;
			if(i != count-1){
				hasNext = 1;
			}
			
			ret[i] = hasNext<<7 | ((value>>(7*i))&(127));
		}		
		
		return ret;
	}