private static void createDecodeTables(int limit[], int base[], int perm[], byte length[], int minLen, int maxLen, int alphaSize) {
		int pp = 0;
		for (int i = minLen; i <= maxLen; i++) {
			for (int j = 0; j < alphaSize; j++)
				if (length[j] == i) {
					perm[pp] = j;
					pp++;
				}

		}

		for (int j1 = 0; j1 < MAX_CODE_LEN; j1++)
			base[j1] = 0;

		for (int k1 = 0; k1 < alphaSize; k1++)
			base[length[k1] + 1]++;

		for (int l1 = 1; l1 < MAX_CODE_LEN; l1++)
			base[l1] += base[l1 - 1];

		for (int i2 = 0; i2 < MAX_CODE_LEN; i2++)
			limit[i2] = 0;

		int vec = 0;
		for (int j2 = minLen; j2 <= maxLen; j2++) {
			vec += base[j2 + 1] - base[j2];
			limit[j2] = vec - 1;
			vec <<= 1;
		}

		for (int k2 = minLen + 1; k2 <= maxLen; k2++)
			base[k2] = (limit[k2 - 1] + 1 << 1) - base[k2];

	}