Package it.unimi.dsi.compression
Class Fast64CodeWordCoder
java.lang.Object
it.unimi.dsi.compression.CodeWordCoder
it.unimi.dsi.compression.Fast64CodeWordCoder
- All Implemented Interfaces:
Coder
,PrefixCoder
,Serializable
A fast coder based on a set of codewords of length at most 64.
- See Also:
-
Field Summary
Fields inherited from class it.unimi.dsi.compression.CodeWordCoder
codeWord
-
Constructor Summary
ConstructorDescriptionFast64CodeWordCoder
(BitVector[] codeWord, long[] longCodeWord) Creates a new codeword-based coder using the given vector of codewords. -
Method Summary
Methods inherited from class it.unimi.dsi.compression.CodeWordCoder
codeWords, encode, flush, flush
-
Constructor Details
-
Fast64CodeWordCoder
Creates a new codeword-based coder using the given vector of codewords. The coder will be able to encode symbols numbered from 0 tocodeWord.length-1
, included.- Parameters:
codeWord
- a vector of codewords.longCodeWord
- the same codewords as those specified incodeWord
, but as right-aligned longs written in left-to-right fashion.
-
-
Method Details
-
encode
Description copied from interface:Coder
Encodes a symbol.- Specified by:
encode
in interfaceCoder
- Overrides:
encode
in classCodeWordCoder
- Parameters:
symbol
- a symbol.obs
- the output bit stream where the encoded symbol will be written.- Returns:
- the number of bits written.
- Throws:
IOException
-