public static long b2num(byte[] bytes, int index, Prototype type) {
		if(type==null)
			throw new IllegalArgumentException("type must not be null");
		if(bytes==null)
			throw new IllegalArgumentException("bytes must not be null");
		int len = type.getLength();
		if(bytes.length<index+len)
			throw new IllegalArgumentException();
		long num = 0;
		for(int i=0;i<len;i++){
			num|=((long)bytes[index+i])<<(len-i-1)*8;
		}
        return num;  
    }