AramUtils { public static byte buildAidRefDo(short dataOffset, short dataOffsetMax, byte[] buf, short ofs, RuleEntry entry) { if (ofs >= dataOffset && ofs < dataOffsetMax) { buf[(short) (ofs - dataOffset)] = (byte) 0x4F; } ofs++; if (ofs >= dataOffset && ofs < dataOffsetMax) { buf[(short) (ofs - dataOffset)] = entry.getAidLength(); } ofs++; entry.getAid(buf, ofs, dataOffset, dataOffsetMax); return (byte) (entry.getAidLength() + 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 aidRefDoTest() throws CardException { byte[] data = new byte[AramConstTest.VALID_AID_REF_DO.length]; assertEquals(AramConstTest.VALID_AID_REF_DO.length, AramUtils.buildAidRefDo(DEFAULT_DATA_OFFSET, DEFAULT_DATA_OFFSET_MAX, data, (short) 0, entry)); assertArrayEquals(AramConstTest.VALID_AID_REF_DO, data); }