R
Rob Shepherd
when applying (byte)bit masks to bytes, do i always have to cast my mask in to a byte.
[just realizing i've even had to do it in previous sentence
]
javac output is thus.
....
operator && cannot be applied to byte,int
length += ((packet[13] && 0x0f) << 4);
....
does the compiler assume 0x0f is an int as it would if a long or float value were not
suffixed L or F respectively.
I gather i will not be able to add a 'b' or 'B' to the end of my value (being Hex digits).
I'm getting annoyed with casting all the time!!!
For freq used masks i make
static final byte MASK = 0x??;
which the compiler obviously has no problems with....
I'd rather not make 255 final byte masks though!!!
regards
Rob
[just realizing i've even had to do it in previous sentence
javac output is thus.
....
operator && cannot be applied to byte,int
length += ((packet[13] && 0x0f) << 4);
....
does the compiler assume 0x0f is an int as it would if a long or float value were not
suffixed L or F respectively.
I gather i will not be able to add a 'b' or 'B' to the end of my value (being Hex digits).
I'm getting annoyed with casting all the time!!!
For freq used masks i make
static final byte MASK = 0x??;
which the compiler obviously has no problems with....
I'd rather not make 255 final byte masks though!!!
regards
Rob