test_class.declarator: logger = LoggerFactory.getLogger(GsmUtilTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(GsmUtilTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-gsm/src/test/java/com/cloudhopper/commons/gsm/GsmUtilTest.java
test_class.identifier: GsmUtilTest
test_case.body: @Test(expected=IllegalArgumentException.class)
      public void toBcdWithStringInvalidDigits() {
          byte[] bytes0 = GsmUtil.toBcd("131 5554272");
      }
test_case.class_method_signature: GsmUtilTest.toBcdWithStringInvalidDigits()
test_case.full_signature: @Test(expected=IllegalArgumentException.class) public void toBcdWithStringInvalidDigits()
test_case.identifier: toBcdWithStringInvalidDigits
test_case.invocations: toBcd
test_case.modifiers: @Test(expected=IllegalArgumentException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toBcdWithStringInvalidDigits()
focal_class.file: ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/GsmUtil.java
focal_class.identifier: GsmUtil
focal_class.class_method_signature: GsmUtil.toBcd(String address)
focal_class.full_signature: public static byte[] toBcd(String address)
focal_class.identifier: toBcd
focal_class.modifiers: public static
focal_class.parameters: (String address)
focal_class.return: byte[]
focal_class.signature: byte[] toBcd(String address)
focal_class.class_method_signature: GsmUtil.toSubmitInfo(boolean replyPath, boolean udhIndicator,
              boolean deliveryReceipt, int validityPeriodFormat, boolean rejectDuplicates)
focal_class.full_signature: public static byte toSubmitInfo(boolean replyPath, boolean udhIndicator,
              boolean deliveryReceipt, int validityPeriodFormat, boolean rejectDuplicates)
focal_class.identifier: toSubmitInfo
focal_class.modifiers: public static
focal_class.parameters: (boolean replyPath, boolean udhIndicator,
              boolean deliveryReceipt, int validityPeriodFormat, boolean rejectDuplicates)
focal_class.return: byte
focal_class.signature: byte toSubmitInfo(boolean replyPath, boolean udhIndicator,
              boolean deliveryReceipt, int validityPeriodFormat, boolean rejectDuplicates)
focal_class.class_method_signature: GsmUtil.removeUserDataHeader(byte[] shortMessage)
focal_class.full_signature: static public byte[] removeUserDataHeader(byte[] shortMessage)
focal_class.identifier: removeUserDataHeader
focal_class.modifiers: static public
focal_class.parameters: (byte[] shortMessage)
focal_class.return: byte[]
focal_class.signature: byte[] removeUserDataHeader(byte[] shortMessage)
focal_class.class_method_signature: GsmUtil.getShortMessageUserData(byte[] shortMessage)
focal_class.full_signature: static public byte[] getShortMessageUserData(byte[] shortMessage)
focal_class.identifier: getShortMessageUserData
focal_class.modifiers: static public
focal_class.parameters: (byte[] shortMessage)
focal_class.return: byte[]
focal_class.signature: byte[] getShortMessageUserData(byte[] shortMessage)
focal_class.class_method_signature: GsmUtil.getShortMessageUserDataHeader(byte[] shortMessage)
focal_class.full_signature: static public byte[] getShortMessageUserDataHeader(byte[] shortMessage)
focal_class.identifier: getShortMessageUserDataHeader
focal_class.modifiers: static public
focal_class.parameters: (byte[] shortMessage)
focal_class.return: byte[]
focal_class.signature: byte[] getShortMessageUserDataHeader(byte[] shortMessage)
focal_class.class_method_signature: GsmUtil.createConcatenatedBinaryShortMessages(byte[] binaryShortMessage, byte referenceNum)
focal_class.full_signature: static public byte[][] createConcatenatedBinaryShortMessages(byte[] binaryShortMessage, byte referenceNum)
focal_class.identifier: createConcatenatedBinaryShortMessages
focal_class.modifiers: static public
focal_class.parameters: (byte[] binaryShortMessage, byte referenceNum)
focal_class.return: byte[][]
focal_class.signature: byte[][] createConcatenatedBinaryShortMessages(byte[] binaryShortMessage, byte referenceNum)
focal_method.body: public static byte[] toBcd(String address) throws NullPointerException, IllegalArgumentException {
          if (address == null) {
              throw new NullPointerException("Address cannot be null for BCD encoding");
          }
  
          if (!StringUtil.containsOnlyDigits(address)) {
              throw new IllegalArgumentException("Address must only contain digits");
          }
  
          // make sure this address is always an even length
          if (address.length() % 2 != 0) {
              // add an extra F onto the end
              address = address + "F";
          }
  
          // calculate length of final byte[]
          int bytes_len = address.length() / 2;
          byte[] bcd = new byte[bytes_len];
  
          for (int i = 0; i < bytes_len; i++) {
              StringBuilder chunk = new StringBuilder(address.substring(i * 2, (i * 2) + 2));
              // reverse the digits since its BCD encoded
              chunk.reverse();
              // get the byte
              byte[] bytes = HexUtil.toByteArray(chunk.toString());
              //byte[] bytes = ByteUtil.decodeHex(chunk.toString(), 2);
              // add this byte onto our total
              bcd[i] = bytes[0];
          }
  
          return bcd;
      }
focal_method.class_method_signature: GsmUtil.toBcd(String address)
focal_method.full_signature: public static byte[] toBcd(String address)
focal_method.identifier: toBcd
focal_method.invocations: containsOnlyDigits length length substring reverse toByteArray toString
focal_method.modifiers: public static
focal_method.parameters: (String address)
focal_method.return: byte[]
focal_method.signature: byte[] toBcd(String address)