Dim inline as JavaObject
....
inline=Me
Dim value As Int = 23
' params = Value,bit start, bit end (inclusive)
Log(inline.RunMethod("getBits",Array(value,0,2)))
Log(inline.RunMethod("getBits",Array(value,3,5)))
....
#if java
public static byte getBits(int v,int st,int end){
byte res = 0;
for(int a=st;a<=end;a++){
res += (byte)(1<<a);
}
return (byte)((res & v)>>st);
}
#end if