Home
last modified time | relevance | path

Searched refs:hexString (Results 1 – 10 of 10) sorted by relevance

/packages/modules/IPsec/tests/iketests/src/java/com/android/internal/net/
DTestUtils.java33 public static byte[] hexStringToByteArray(String hexString) { in hexStringToByteArray() argument
34 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() argument
49 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()
/packages/modules/NetworkStack/tests/unit/src/android/net/netlink/
DNduseroptMessageTest.java161 final String hexString = HDR_16BYTE + "00000000000000000000000000000000" + NLA_SRCADDR; in testZeroLengthOption() local
162 ByteBuffer buf = toBuffer(hexString); in testZeroLengthOption()
173 final String hexString = HDR_16BYTE + "26030000000000000000000000000000" + NLA_SRCADDR; in testTooLongOption() local
174 ByteBuffer buf = toBuffer(hexString); in testTooLongOption()
184 String hexString = HDR_32BYTE + OPT_PREF64; in testOptionsTooLong() local
185 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 …]
/packages/providers/ContactsProvider/src/com/android/providers/contacts/util/
DHex.java82 public static byte[] decodeHex(String hexString) { in decodeHex() argument
83 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()
/packages/apps/CertInstaller/src/com/android/certinstaller/
DUtil.java71 StringBuilder hexString = new StringBuilder(); in toHexString() local
73 hexString.append(Integer.toHexString(0xFF & b)).append(separator); in toHexString()
75 return hexString.toString(); in toHexString()
/packages/modules/IPsec/src/java/com/android/internal/net/eap/message/mschapv2/
DEapMsChapV2TypeData.java446 static byte[] hexStringToByteArray(String hexString) in hexStringToByteArray() argument
448 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()
/packages/services/BuiltInPrintService/src/com/android/bips/ipp/
DCertificateStore.java172 private static byte[] hexToBytes(String hexString) { in hexToBytes() argument
173 if (hexString == null) { in hexToBytes()
177 char[] source = hexString.toCharArray(); in hexToBytes()
/packages/inputmethods/LatinIME/common/src/com/android/inputmethod/latin/common/
DStringUtils.java571 public static byte[] hexStringToByteArray(@Nullable final String hexString) { in hexStringToByteArray() argument
572 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()
/packages/modules/IPsec/src/java/com/android/internal/net/utils/
DBigIntegerUtils.java29 public static BigInteger unsignedHexStringToBigInteger(String hexString) { in unsignedHexStringToBigInteger() argument
30 return new BigInteger(hexString, 16); in unsignedHexStringToBigInteger()
/packages/modules/NetworkStack/src/android/net/dhcp/
DDhcpPacket.java802 String hexString = "0" + Integer.toHexString(mac[i]); in macToString() local
806 macAddr += hexString.substring(hexString.length() - 2); in macToString()
/packages/modules/NetworkStack/tests/unit/src/android/net/dhcp/
DDhcpPacketTest.java675 String hexString = String.format("1a02%04xff", mtu); in mtuBytes() local
676 return HexDump.hexStringToByteArray(hexString); in mtuBytes()