int numSymbols = freqs.length;
    public void buildCodes() {      int numSymbols = freqs.length;      int[] nextCode = new int[maxLength];      int code = 0;      codes = new short[freqs.length];      if (DeflaterConstants.DEBUGGING)	System.err.println("buildCodes: "+freqs.length);      for (int bits = 0; bits < maxLength; bits++) 	{	  nextCode[bits] = code;	  code += bl_counts[bits] << (15 - bits);	  if (DeflaterConstants.DEBUGGING)	    System.err.println("bits: "+(bits+1)+" count: "+bl_counts[bits]			       +" nextCode: "+Integer.toHexString(code));	}      if (DeflaterConstants.DEBUGGING && code != 65536)	throw new RuntimeException("Inconsistent bl_counts!");            for (int i=0; i < numCodes; i++)	{	  int bits = length[i];	  if (bits > 0)	    {	      if (DeflaterConstants.DEBUGGING)		System.err.println("codes["+i+"] = rev("				   +Integer.toHexString(nextCode[bits-1])+"),"				   +bits);	      codes[i] = bitReverse(nextCode[bits-1]);	      nextCode[bits-1] += 1 << (16 - bits);	    }	}    }