diff --git a/library/src/main/java/pro/javacard/gp/SEAccessControl.java b/library/src/main/java/pro/javacard/gp/SEAccessControl.java index 530b20a0..7ecd02b8 100644 --- a/library/src/main/java/pro/javacard/gp/SEAccessControl.java +++ b/library/src/main/java/pro/javacard/gp/SEAccessControl.java @@ -602,6 +602,11 @@ public byte[] getData() { return Arrays.copyOf(data, data.length); } + public void addData(final byte[] source) { + System.arraycopy(source, 0, data, currentIndex, source.length); + currentIndex += source.length; + } + public int getLength() { return length; } @@ -609,10 +614,6 @@ public int getLength() { public int getCurrentIndex() { return currentIndex; } - - public void setCurrentIndex(int index) { - this.currentIndex = index; - } } /* @@ -662,8 +663,7 @@ public static BerTlvData getAcrListData(final BerTlvData previousData, final byt System.arraycopy(data, offset, berData, 0, data.length - offset); return new BerTlvData(berData, length, data.length - offset); } else if (previousData != null) { - System.arraycopy(data, 0, previousData.getData(), previousData.currentIndex, data.length); - previousData.setCurrentIndex(data.length + previousData.currentIndex); + previousData.addData(data); return previousData; } else { throw new GPDataException("ACR get data : bad response format (GET_DATA)");