Interface Coder
- All Known Subinterfaces:
PrefixCoder
- All Known Implementing Classes:
CodeWordCoder, Fast64CodeWordCoder
public interface Coder
Coding methods for a specific compression technique.
-
Method Summary
Modifier and TypeMethodDescriptionit.unimi.dsi.fastutil.booleans.BooleanIteratorencode(int symbol) Encodes a symbol.intencode(int symbol, OutputBitStream obs) Encodes a symbol.it.unimi.dsi.fastutil.booleans.BooleanIteratorflush()Flushes the coder.intflush(OutputBitStream obs) Flushes the coder.
-
Method Details
-
encode
it.unimi.dsi.fastutil.booleans.BooleanIterator encode(int symbol) Encodes a symbol.- Parameters:
symbol- a symbol.- Returns:
- a boolean iterator returning the bits coding
symbol.
-
encode
Encodes a symbol.- Parameters:
symbol- a symbol.obs- the output bit stream where the encoded symbol will be written.- Returns:
- the number of bits written.
- Throws:
IOException
-
flush
Flushes the coder. Warning: this method will notflushobs.- Parameters:
obs- the output bit stream where the flushing bits will be written.- Returns:
- the number of bits written to flush the coder.
-
flush
it.unimi.dsi.fastutil.booleans.BooleanIterator flush()Flushes the coder.- Returns:
- a boolean iterator returning the bits used to flush this coder.
-