public void writeToCard(String data) throws TagConnectionException {
		byte[] bytes = data.getBytes();
		if (ACRNfcConnection.DEBUG)
			NFCIPConnection.printByteArray(bytes);
		int length = bytes.length;
		if (length > MIFARE1K_AVAILABLE) {
			throw new TagConnectionException(
					"Cannot write this much data to the card");
		}
		byte[] bytePointer = null;
		ArrayList<byte[]> myList = new ArrayList<byte[]>();
		for (int i = 0; i < length; i++) {
			int relativeByte = i % MIFARE1K_BLOCK_SIZE;
			if (relativeByte == 0) {
				if (bytePointer != null)
					myList.add(bytePointer);
				bytePointer = new byte[MIFARE1K_BLOCK_SIZE];
				bytePointer[0] = bytes[i];
			} else {
				bytePointer[relativeByte] = bytes[i];
			}

			if (i + 1 >= length && bytePointer != null) {
				myList.add(bytePointer);
			}
		}

		Integer block = BLOCK_START;
		for (byte[] x : myList) {
			connection.writeCardBinary(block.byteValue(), x);
			block++;
		}

	}