private String CharToHamming(char c)
	{
		// binary format of ascii of char c
		String binaryStringShort = Integer.toBinaryString((int)c);
		
		// fill the 0s to get 8 bits
		StringBuffer paddingBuffer = new StringBuffer();
		while(paddingBuffer.length() < 8 - binaryStringShort.length())
		{
			paddingBuffer.append("0");
		}		
		String binaryString = paddingBuffer.toString() + binaryStringShort;
		
		// split the source into 2 parts
		String binaryString1 = binaryString.substring(0, 4);
		String binaryString2 = binaryString.substring(4, 8);
		
		// encode each part
		int index1 = Integer.valueOf(binaryString1, 2);
		int index2 = Integer.valueOf(binaryString2, 2);
		
		// the final codeword
		String codewordString = codewordTable[index1] + codewordTable[index2];
		
		return codewordString; 
	}