buffer is a bytebuffer .I'm getting a lost of percision error with this.
byte myPort = buffer.get(0); // Might need to change this depending on byte order
switch(myPort){
case 0xF1: // Chat service
break;
case 0xF2: // Voice service
break;
case 0xF3: // Video service
break;
case 0xF4: // File transfer service
break;
case 0xF5: // Remote login
break;
}
Apparently, 0xFF is not a byte in java and its really confusing me. I don't know if I'm losing it but isn't 0xF a nibble and 0xFF a byte? Apparently my ide netbeans allows byte values all the way up to 127. This seems to be a problem with signed values, but I'm not sure why.
Thanks for any help.