loginIntoSector(access);
MfBlock[] returnBlocks = new Block[access.getBlocksToRead()];
for (int currentBlock = 0; currentBlock < access.getBlocksToRead(); currentBlock++) {
blockNumber = (byte)memoryLayout.getBlockNumber(access.getSector(), access.getBlock() + currentBlock);
Command readBlock = new Command(Apdu.INS_READ_BINARY, 0x00, blockNumber, 16);
Response readBlockResponse;
readBlockResponse = apduTag.transmit(readBlock);
if (!readBlockResponse.isSuccess()) {
throw new MfException("Reading block failed. Sector: " + access.getSector() + ", Block: "
+ access.getBlock() + " Key: " + access.getKeyValue().getKey().name() + ", Response: "
+ readBlockResponse);
}
returnBlocks[currentBlock] = BlockResolver.resolveBlock(memoryLayout, access.getSector(), currentBlock
+ access.getBlock(), readBlockResponse.getData());
}
return returnBlocks;
}