code: public static String decodeBcd(byte[] data, int offset, int len) {
          StringBuilder result = new StringBuilder();
  
          // loop through byte array until we get to the end or an F
          for (int i = offset; i < (offset + len); i++) {
              // get buffer
              StringBuilder x = new StringBuilder(encodeHex(data[i]));
              // reverse it
              x.reverse();
              // add it to the data
              if (x.charAt(1) == 'F' || x.charAt(1) == 'f') {
                  result.append(x.substring(0, 1));
              } else {
                  result.append(x.toString());
              }
          }
          return result.toString();
      }
docs: BCD decodes a byte array into a String. For example, addresses inside
  PDUs for SMS are usually BCD encoded.  An address of "13134434272" will
  actually look like this inside the byte[] "31314443722F"
  
  len is the number of bytes
  to read.