private static EntropyEncoder getEncoder(String name, OutputBitStream obs)
    {
       switch(name) 
       {
          case "FPAQ":
          case "CM":
          case "PAQ":
          case "TPAQ":
             return new BinaryEntropyEncoder(obs, getPredictor(name));
             
          case "HUFFMAN":
             return new HuffmanEncoder(obs);
             
          case "ANS":
             return new ANSRangeEncoder(obs);
             
          case "RANGE":
             return new RangeEncoder(obs);
          
          case "EXPGOLOMB":
             return new ExpGolombEncoder(obs, true);
          
          case "RICEGOLOMB":
             return new RiceGolombEncoder(obs, true, 4);
          
          default:
             System.out.println("No such entropy encoder: "+name);
             return null;
       }
    }