Package com.pixelmed.scpecg
Class HuffmanDecoder
java.lang.Object
com.pixelmed.scpecg.HuffmanDecoder
A class to implement Huffman decoding as used by the SCP-ECG standard.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHuffmanDecoder
(byte[] bytesToDecompress, int differenceDataUsed, int multiplier, int numberOfHuffmanTables, ArrayList huffmanTablesList) Construct a Huffman decoder for the supplied encoded data, as read from an SCP-ECG file. -
Method Summary
-
Constructor Details
-
HuffmanDecoder
public HuffmanDecoder(byte[] bytesToDecompress, int differenceDataUsed, int multiplier, int numberOfHuffmanTables, ArrayList huffmanTablesList) Construct a Huffman decoder for the supplied encoded data, as read from an SCP-ECG file.
- Parameters:
bytesToDecompress
- the compressed datadifferenceDataUsed
- 0 = no, 1 = 1 difference value, 2 = 2 difference valuesmultiplier
- a value by which to scale the decoded valuesnumberOfHuffmanTables
- how many tables are available for usehuffmanTablesList
- the Huffman tables themselves
-
-
Method Details
-
decode
Decode a single value.
- Returns:
- the decoded value
- Throws:
Exception
-
decode
Decode a specified number of values.
- Parameters:
nValuesWanted
- the number of decoded values wanted- Returns:
- the decoded values
- Throws:
Exception
-
toString
Dump the current decoder state as a
String
. -
main
For testing.
Decodes the byte stream in the example specified in the SCP-ECG standard.
- Parameters:
arg
- none
-