How do I take the byte value out of this class?
<p>I want to take the byte value out of this class so I can parse it, or if it's possible parse it inside and get the 5th and 6th byte value out. </p>

<pre><code>private void broadcastUpdate(final String action,
                             final BluetoothGattCharacteristic characteristic) {
    final Intent intent = new Intent(action);

    // This is special handling for the Heart Rate Measurement profile.  Data parsing is
    // carried out as per profile specifications:
    // http://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml
    if (UUID_HEART_RATE_MEASUREMENT.equals(characteristic.getUuid())) {
        final byte[] data = characteristic.getValue();




        if (data != null &amp;&amp; data.length &gt; 0) {
            final StringBuilder stringBuilder = new StringBuilder(data.length);
            for(byte byteChar : data)
                stringBuilder.append(String.format("%02X", byteChar));
            intent.putExtra(EXTRA_DATA, new String(data) + "\n" + stringBuilder.toString());




        } else {
            // For all other profiles, writes the data formatted in HEX.


        }

    }


    sendBroadcast(intent);

}
</code></pre>

<p>How this works is that I step on a scale and it sends me these bytes:</p>

<pre><code>00 00 00 00 02 02 00 00 00 00 00 00 00 00 00 00
</code></pre>

<p>Which is stored at the variable 'data'. How do I take 'data' out to use in another class?</p>

<p>The weight data is on bytes 5 and 6. If you convert the hex values of bytes 5 and 6, in that example is '<code>0202</code>' it becomes 514 in decimal (51.4kg).</p>

<p>I need to take the bytes data to use in another class to get the kg data. How would I go around doing so?</p>