once again, i'm stuck: this time a bit more complicated. see if anyone can give some tips.
overveiw: i'm writting a software to operate a device (an RFID). it operates in bitwise command. i need to send a packet of binary (=hex) number through rs232 serial port.
problem: the packet has to be in the grup of 8 bits (1 byte). i did it in C, they have this "unsigned char" that has 8 bit. problem with java is, its char is 16 bits(2 bytes). i tryed to use "byte" type variable in java, but i can't. because i can't assign something like
byte var1=0xFF; i'm not able to change the Most sig bit to 1.
and if i'm using a bigger variable say char or int, my device will not take it since they are padded with a huge line of zeros. what can i do? any idea?
in short, i need 8 bit of space where i can use all eight.
|