Feeling like a dumb ass. But thinkning in binary has never been my strong suit. The problem is I have to write a java prog that spits out a series of bytes - to "AN" output stream. This is fine. WriteBytes(x) would suffice. My problem is getting the correct definition of data inside x.
x is probably going to be a byte array (or whatever if you guys can suggest something better). x[0] has to be = 0x47 in hex. So this part is fine. The place where - for some reason - my head waves a flag is at x[1]. At this point I need to define only 3 binary digits - which are flags. Then the start of a 13 bit address (so only the first 5 bits of this are in x[1] then rest are in x[2]).
How ?? Do you write in binary in java ? It really appears as though it is hidden VERY well.