Lines Matching full:byte
38 * byte-array based communication channel. It is left to developers to implement higher level
49 private static final byte[] SELECT_OK_SW = HexStringToByteArray("9000");
51 private static final byte[] UNKNOWN_CMD_SW = HexStringToByteArray("0000");
52 private static final byte[] SELECT_APDU = BuildSelectApdu(SAMPLE_LOYALTY_CARD_AID);
66 * response APDU can be provided directly by returning a byte-array in this method. In general
76 * #sendResponseApdu(byte[])} method later.
80 * @return a byte-array containing the response APDU, or null if no response APDU can be sent
85 public byte[] processCommandApdu(byte[] commandApdu, Bundle extras) {
91 byte[] accountBytes = account.getBytes();
107 public static byte[] BuildSelectApdu(String aid) {
114 * Utility method to convert a byte array to a hexadecimal string.
119 public static String ByteArrayToHexString(byte[] bytes) {
121 char[] hexChars = new char[bytes.length * 2]; // Each byte has two hex characters (nibbles)
132 * Utility method to convert a hexadecimal string to a byte string.
137 * @return Byte array generated from input
140 public static byte[] HexStringToByteArray(String s) throws IllegalArgumentException {
145 byte[] data = new byte[len / 2]; // Allocate 1 byte per 2 hex characters
148 data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
155 * Utility method to concatenate two byte arrays.
160 public static byte[] ConcatArrays(byte[] first, byte[]... rest) {
162 for (byte[] array : rest) {
165 byte[] result = Arrays.copyOf(first, totalLength);
167 for (byte[] array : rest) {