public static void compressFile(String inputFile, String output){
		////Setup////
		readCharacters(inputFile);//Get every character in the file
		generateFrequency();//Generate a frequency map and get every unique character
		buildTrie();//Build the trie and generate a translation map

		//Create Header
		ByteBuffer header = ByteBuffer.allocate(unique.size()*5+5);
		for(char c : unique){
			header.put((byte)c);
			header.putInt(frequency.get(c));
		}
		//End of Header:
		header.put((byte)0);
		header.putInt(0);

		header.flip();//Reset pointers on header

		//Create string of the translation code
		StringBuilder stringCode = new StringBuilder();
		for(char c : characters){
			stringCode.append(translate.get(c));
		}
		//TODO MAYBE INSERT THE EOF CHARACTER

		//Append extra 0s to make full byte
		while((stringCode.length()%8 != 0))
			stringCode.append('0');


		String str = stringCode.toString();//Use for parsing

		//Actual translation in bytes
		ByteBuffer code = ByteBuffer.allocate(str.length()/8);//Allocate enough memory for the bytes

		//Looping through 8 bits of the string representation
		int i = 0; int j = 8;
		while(j <= stringCode.length()){
			String sub = str.substring(i, j);//create a substring of byte size
			int b = Integer.parseInt(sub, 2);//parse an integer in binary from the bits
			code.put((byte)b);//place the byte into the code
			i+= 8; j+=8;//increment
		}

		code.flip();//Reset the pointers for the code

		//Write the bytes to a text file	
		try{
			//Prepare output
			FileOutputStream io = new FileOutputStream(new File(output));
			BufferedOutputStream buff = new BufferedOutputStream(io);
			//Write the header and code
			byte[] input = header.array();
			buff.write(input);
			input = code.array();
			buff.write(input);

			buff.close();//Necessary, close the stream.

		}catch(Exception e){
			e.printStackTrace();
		}
	}