public Byte[] compress(HuffmanTree tree, Byte[] byteArray) {
		//For each byte in the Array, shove it through the tree and get it's new encoding.
		List<Byte> newByteList = new ArrayList<Byte>();
		Bits bits = new Bits();
		
		for (byte b : byteArray) {
			tree.fromByte(b, bits);
		}
		boolean buildingBytes = true;
		while (buildingBytes) {
			byte nextByte = (byte) Integer.parseInt("00000000", 2);
			for (int i = 0; i < 8; i++) {
				if (bits.poll()) {
					nextByte = (byte) (nextByte | (1 << i));
				} else {
					nextByte = (byte) (nextByte & ~(1 << i));
				}
			}
			newByteList.add(nextByte);
		}
		Byte[] result = (Byte[]) newByteList.toArray();
		return result;
	}