I currently have 16 bits I want to set to variables (2 separate bytes). I've used the BitSet object to hold my bits and while in Java 1.7 there is a toByteArray() method, I need something that works on earlier versions of Java. It doesn't need to use BitSet, but I would prefer that it does (if possible).
If someone could tell me how to write something like 01101011 to a byte, I think that would help me enough. Thanks!