public ResponseAPDU writeBinBlocks(byte blockNum, byte[] blockData)
			throws NFCIPException {
		byte[] write = new byte[this.UPDATE_BIN_BLOCKS.length
				+ blockData.length];
		for (int i = 0; i < this.UPDATE_BIN_BLOCKS.length; i++) {
			write[i] = this.UPDATE_BIN_BLOCKS[i];
			if (i == 3)
				write[i] = blockNum;
			if (i == 4)
				write[i] = Byte.parseByte(String.valueOf(blockData.length));
		}

		for (int i = 5; i < blockData.length + 5; i++) {
			write[i] = blockData[i - 5];
		}

		if (DEBUG)
			printByteArray(write);
		try {
			CommandAPDU d = new CommandAPDU(write);
			if (DEBUG)
				System.out.println(d.toString());
			if (ch == null) {
				throw new NFCIPException("channel not open");
			}
			return ch.transmit(d);
		} catch (CardException e) {
			throw new NFCIPException("problem reading data");
		}
	}