Class Fast64CodeWordCoder

  • All Implemented Interfaces:
    Coder, PrefixCoder, java.io.Serializable

    public final class Fast64CodeWordCoder
    extends CodeWordCoder
    A fast coder based on a set of codewords of length at most 64.
    See Also:
    Serialized Form
    • Constructor Detail

      • Fast64CodeWordCoder

        public Fast64CodeWordCoder​(BitVector[] codeWord,
                                   long[] longCodeWord)
        Creates a new codeword-based coder using the given vector of codewords. The coder will be able to encode symbols numbered from 0 to codeWord.length-1, included.
        Parameters:
        codeWord - a vector of codewords.
        longCodeWord - the same codewords as those specified in codeWord, but as right-aligned longs written in left-to-right fashion.
    • Method Detail

      • encode

        public int encode​(int symbol,
                          OutputBitStream obs)
                   throws java.io.IOException
        Description copied from interface: Coder
        Encodes a symbol.
        Specified by:
        encode in interface Coder
        Overrides:
        encode in class CodeWordCoder
        Parameters:
        symbol - a symbol.
        obs - the output bit stream where the encoded symbol will be written.
        Returns:
        the number of bits written.
        Throws:
        java.io.IOException