AramUtils { public static byte buildRefArDo(short dataOffset, short dataOffsetMax, byte[] buf, short ofs, RuleEntry entry) { if (ofs >= dataOffset && ofs < dataOffsetMax) { buf[(short) (ofs - dataOffset)] = (byte) 0xE2; } ofs++; byte refDoLen = buildRefDo(dataOffset, dataOffsetMax, buf, (short) (ofs + 1), entry); byte arDoLen = buildArDo(dataOffset, dataOffsetMax, buf, (short) (ofs + refDoLen + 1), entry); if (ofs >= dataOffset && ofs < dataOffsetMax) { buf[(short) (ofs - dataOffset)] = (byte) (refDoLen + arDoLen); } return (byte) (refDoLen + arDoLen + 2); }  static byte buildRefArDo(short dataOffset, short dataOffsetMax, byte[] buf, short ofs, RuleEntry entry); static byte buildRefDo(short dataOffset, short dataOffsetMax, byte[] buf, short ofs, RuleEntry entry); static byte buildArDo(short dataOffset, short dataOffsetMax, byte[] buf, short ofs, RuleEntry entry); static byte buildAidRefDo(short dataOffset, short dataOffsetMax, byte[] buf, short ofs, RuleEntry entry); static byte buildHashRefDo(short dataOffset, short dataOffsetMax, byte[] buf, short ofs, RuleEntry entry);  }
@Test public void refArDoTest() throws CardException { byte[] data = new byte[VALID_REF_AR_DO.length]; assertEquals(VALID_REF_AR_DO.length, AramUtils.buildRefArDo(DEFAULT_DATA_OFFSET, DEFAULT_DATA_OFFSET_MAX, data, (short) 0, entry)); assertArrayEquals(VALID_REF_AR_DO, data); }