readBinary method
Sends READ BINARY command to ICC.
It returns ne long chunk of data at offset.
Max offset can be 32 766. ne must not overlap offset 32 767.
Can throw ICCError if R-APDU returns no data and error status or ComProviderError.
Note: Use readBinaryExt to read data chunks at offsets greater than 32 767.
Implementation
Future<ResponseAPDU> readBinary(
{required int offset,
required int ne,
int cla = ISO7816_CLA.NO_SM}) async {
if (offset > 32766) {
throw ArgumentError.value(
offset, null, "Max read binary offset can be 32 767 bytes");
}
Uint8List rawOffset = Utils.intToBin(offset, minLen: 2);
final p1 = rawOffset[0];
final p2 = rawOffset[1];
return await _readBinary(CommandAPDU(
cla: cla, ins: ISO7816_INS.READ_BINARY, p1: p1, p2: p2, ne: ne));
}