title: Converting sections of byte arrays to integer values
body: <p>I am currently making an android application which accepts bluetooth measurement from a device. The way the data is packaged is in 4 bytes. I need to get two values out of these bytes. </p>
  
  <p>First value is made up of: 6bit and 7bit of first byte and bit 0 to bit 6 of byte 2</p>
  
  <p>Second values is simpler and consists of the full 3rd byte.</p>
  
  <p>What is a good way to access these bit values, combine them and convert them to integer values? Right now i'm trying to convert from byte array to bitset, and then access individual bits to create new bytes that would then be converted to a integer.</p>
  
  <p>Thanks, and please ask if I am not being clear enough.</p>