// Path: java/src/main/java/kanzi/EntropyDecoder.java
// public interface EntropyDecoder
// {
//     // Decode the next chunk of data from the bitstream and return in the
//     // provided buffer.
//     public int decode(byte[] buffer, int blkptr, int len);
// 
//     // Must be called before getting rid of the entropy coder
//     public void dispose();
// 
//     // Return the underlying bitstream
//     public InputBitStream getBitStream();
// }
// 
// Path: java/src/main/java/kanzi/EntropyEncoder.java
// public interface EntropyEncoder
// {
//     // Encode the array provided into the bitstream. Return the number of bytes
//     // written to the bitstream
//     public int encode(byte[] array, int blkptr, int len);
// 
//     // Return the underlying bitstream
//     public OutputBitStream getBitStream();
// 
//     // Must be called before getting rid of the entropy coder
//     // Trying to encode after a call to dispose gives undefined behavior
//     public void dispose();
// }
// 
// Path: java/src/main/java/kanzi/InputBitStream.java
// public interface InputBitStream
// {
//    // Return 1 or 0
//    public int readBit() throws BitStreamException;
// 
//    // Length is the number of bits in [1..64]. Return the bits read as a long
//    // Throws if the stream is closed.
//    public long readBits(int length) throws BitStreamException;
// 
//    // Read bits and put them in the byte array at index 'start'.
//    // Length is the number of bits
//    // Return the number of bits read.
//    // Throws if the stream is closed.
//    public int readBits(byte[] bits, int start, int length) throws BitStreamException;
// 
//    public void close() throws BitStreamException;
// 
//    // Number of bits read
//    public long read();
// 
//    // Return false when the bitstream is closed or the End-Of-Stream has been reached
//    public boolean hasMoreToRead();
// }
// 
// Path: java/src/main/java/kanzi/OutputBitStream.java
// public interface OutputBitStream
// {
//    // Write the least significant bit of the input integer
//    // Throws if the stream is closed.
//    public void writeBit(int bit) throws BitStreamException;
// 
//    // Length is the number of bits in [1..64]. Return the number of bits written.
//    // Throws if the stream is closed.
//    public int writeBits(long bits, int length) throws BitStreamException;
// 
//    // Write bits ouf of the byte array at index 'start'.
//    // Length is the number of bits.
//    // Return the number of bits written.
//    // Throws if the stream is closed.
//    public int writeBits(byte[] bits, int start, int nbBits) throws BitStreamException;
// 
//    public void close() throws BitStreamException;
// 
//    // Number of bits written
//    public long written();
// }


import java.util.Map;
import kanzi.EntropyDecoder;
import kanzi.EntropyEncoder;
import kanzi.InputBitStream;
import kanzi.OutputBitStream;
            return new ANSRangeEncoder(obs, 1, ctx);

         case RANGE_TYPE:
            return new RangeEncoder(obs);

         case FPAQ_TYPE:
            return new FPAQEncoder(obs);

         case CM_TYPE:
            return new BinaryEntropyEncoder(obs, new CMPredictor());

         case TPAQ_TYPE:
            return new BinaryEntropyEncoder(obs, new TPAQPredictor(ctx));

         case TPAQX_TYPE:
            return new BinaryEntropyEncoder(obs, new TPAQPredictor(ctx));

         case NONE_TYPE:
            return new NullEntropyEncoder(obs);

         default :
            throw new IllegalArgumentException("Unknown entropy codec type: '" + (char) entropyType + "'");
      }
   }


   public static String getName(int entropyType)
   {
      switch (entropyType)
      {
// Path: java/src/main/java/kanzi/EntropyDecoder.java
// public interface EntropyDecoder
// {
//     // Decode the next chunk of data from the bitstream and return in the
//     // provided buffer.
//     public int decode(byte[] buffer, int blkptr, int len);
// 
//     // Must be called before getting rid of the entropy coder
//     public void dispose();
// 
//     // Return the underlying bitstream
//     public InputBitStream getBitStream();
// }
// 
// Path: java/src/main/java/kanzi/EntropyEncoder.java
// public interface EntropyEncoder
// {
//     // Encode the array provided into the bitstream. Return the number of bytes
//     // written to the bitstream
//     public int encode(byte[] array, int blkptr, int len);
// 
//     // Return the underlying bitstream
//     public OutputBitStream getBitStream();
// 
//     // Must be called before getting rid of the entropy coder
//     // Trying to encode after a call to dispose gives undefined behavior
//     public void dispose();
// }
// 
// Path: java/src/main/java/kanzi/InputBitStream.java
// public interface InputBitStream
// {
//    // Return 1 or 0
//    public int readBit() throws BitStreamException;
// 
//    // Length is the number of bits in [1..64]. Return the bits read as a long
//    // Throws if the stream is closed.
//    public long readBits(int length) throws BitStreamException;
// 
//    // Read bits and put them in the byte array at index 'start'.
//    // Length is the number of bits
//    // Return the number of bits read.
//    // Throws if the stream is closed.
//    public int readBits(byte[] bits, int start, int length) throws BitStreamException;
// 
//    public void close() throws BitStreamException;
// 
//    // Number of bits read
//    public long read();
// 
//    // Return false when the bitstream is closed or the End-Of-Stream has been reached
//    public boolean hasMoreToRead();
// }
// 
// Path: java/src/main/java/kanzi/OutputBitStream.java
// public interface OutputBitStream
// {
//    // Write the least significant bit of the input integer
//    // Throws if the stream is closed.
//    public void writeBit(int bit) throws BitStreamException;
// 
//    // Length is the number of bits in [1..64]. Return the number of bits written.
//    // Throws if the stream is closed.
//    public int writeBits(long bits, int length) throws BitStreamException;
// 
//    // Write bits ouf of the byte array at index 'start'.
//    // Length is the number of bits.
//    // Return the number of bits written.
//    // Throws if the stream is closed.
//    public int writeBits(byte[] bits, int start, int nbBits) throws BitStreamException;
// 
//    public void close() throws BitStreamException;
// 
//    // Number of bits written
//    public long written();
// }


// Path: java/src/main/java/kanzi/entropy/EntropyCodecFactory.java
import java.util.Map;
import kanzi.EntropyDecoder;
import kanzi.EntropyEncoder;
import kanzi.InputBitStream;
import kanzi.OutputBitStream;

            return new ANSRangeEncoder(obs, 1, ctx);

         case RANGE_TYPE:
            return new RangeEncoder(obs);

         case FPAQ_TYPE:
            return new FPAQEncoder(obs);

         case CM_TYPE:
            return new BinaryEntropyEncoder(obs, new CMPredictor());

         case TPAQ_TYPE:
            return new BinaryEntropyEncoder(obs, new TPAQPredictor(ctx));

         case TPAQX_TYPE:
            return new BinaryEntropyEncoder(obs, new TPAQPredictor(ctx));

         case NONE_TYPE:
            return new NullEntropyEncoder(obs);

         default :
            throw new IllegalArgumentException("Unknown entropy codec type: '" + (char) entropyType + "'");
      }
   }


   public static String getName(int entropyType)
   {
      switch (entropyType)
      {
         case HUFFMAN_TYPE: