Searched refs:hexString (Results 1 – 10 of 10) sorted by relevance
33 public static byte[] hexStringToByteArray(String hexString) { in hexStringToByteArray() argument34 int len = hexString.length(); in hexStringToByteArray()42 ((Character.digit(hexString.charAt(i), 16) << 4) in hexStringToByteArray()43 + Character.digit(hexString.charAt(i + 1), 16)); in hexStringToByteArray()48 public static int hexStringToInt(String hexString) { in hexStringToInt() argument49 if (hexString.length() > 8) { in hexStringToInt()53 for (int i = hexString.length(); i < 8; i++) { in hexStringToInt()54 hexString = "0" + hexString; in hexStringToInt()57 return ByteBuffer.wrap(hexStringToByteArray(hexString)).getInt(); in hexStringToInt()
161 final String hexString = HDR_16BYTE + "00000000000000000000000000000000" + NLA_SRCADDR; in testZeroLengthOption() local162 ByteBuffer buf = toBuffer(hexString); in testZeroLengthOption()173 final String hexString = HDR_16BYTE + "26030000000000000000000000000000" + NLA_SRCADDR; in testTooLongOption() local174 ByteBuffer buf = toBuffer(hexString); in testTooLongOption()184 String hexString = HDR_32BYTE + OPT_PREF64; in testOptionsTooLong() local185 ByteBuffer buf = toBuffer(hexString); in testOptionsTooLong()187 assertNull(NduseroptMessage.parse(toBuffer(hexString))); in testOptionsTooLong()190 hexString = HDR_32BYTE + OPT_PREF64 + OPT_PREF64; in testOptionsTooLong()191 buf = toBuffer(hexString); in testOptionsTooLong()193 assertNull(NduseroptMessage.parse(toBuffer(hexString))); in testOptionsTooLong()[all …]
82 public static byte[] decodeHex(String hexString) { in decodeHex() argument83 int length = hexString.length(); in decodeHex()86 throw new IllegalArgumentException("Odd number of characters: " + hexString); in decodeHex()92 int c1 = hexString.charAt(j++); in decodeHex()104 int c2 = hexString.charAt(j++); in decodeHex()120 throw new IllegalArgumentException("Invalid hexadecimal digit: " + hexString); in decodeHex()
71 StringBuilder hexString = new StringBuilder(); in toHexString() local73 hexString.append(Integer.toHexString(0xFF & b)).append(separator); in toHexString()75 return hexString.toString(); in toHexString()
446 static byte[] hexStringToByteArray(String hexString) in hexStringToByteArray() argument448 if (hexString.length() % 2 != 0) { in hexStringToByteArray()453 byte[] dataBytes = new byte[hexString.length() / 2]; in hexStringToByteArray()454 for (int i = 0; i < hexString.length(); i += 2) { in hexStringToByteArray()455 dataBytes[i / 2] = (byte) Integer.parseInt(hexString.substring(i, i + 2), 16); in hexStringToByteArray()
172 private static byte[] hexToBytes(String hexString) { in hexToBytes() argument173 if (hexString == null) { in hexToBytes()177 char[] source = hexString.toCharArray(); in hexToBytes()
571 public static byte[] hexStringToByteArray(@Nullable final String hexString) { in hexStringToByteArray() argument572 if (isEmpty(hexString)) { in hexStringToByteArray()575 final int N = hexString.length(); in hexStringToByteArray()582 bytes[i / 2] = (byte) ((Character.digit(hexString.charAt(i), 16) << 4) in hexStringToByteArray()583 + Character.digit(hexString.charAt(i + 1), 16)); in hexStringToByteArray()
29 public static BigInteger unsignedHexStringToBigInteger(String hexString) { in unsignedHexStringToBigInteger() argument30 return new BigInteger(hexString, 16); in unsignedHexStringToBigInteger()
802 String hexString = "0" + Integer.toHexString(mac[i]); in macToString() local806 macAddr += hexString.substring(hexString.length() - 2); in macToString()
675 String hexString = String.format("1a02%04xff", mtu); in mtuBytes() local676 return HexDump.hexStringToByteArray(hexString); in mtuBytes()