Class HuffmanTable
java.lang.Object
org.web3d.vrml.export.compressors.HuffmanTable
Prototype Huffman node. Borrowed original impl from Sun HuffmanNode, need to decide
if copyright still stands for heavily modified code.
- Version:
- $Revision: 1.4 $
- Author:
- Alan Hudson
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear this HuffmanTable instance.void
Compute optimized tags for each position, color, and normal entry.void
decode
(byte[] tags, int[] data) Decode a tag into a HuffmanNode.getEntry
(HuffmanNode node) void
print()
Print the contents of this instance to standard out.void
readDict
(InputStream dis) Read the dictIonary from a stream.void
setDataLength
(int dataLength) Set the length of each data element in bits.int
Get the total number of bits needed to writeout the stream used to create this table.void
Write the dictionary.
-
Method Details
-
setDataLength
public void setDataLength(int dataLength) Set the length of each data element in bits.- Parameters:
dataLength
- The length.
-
streamBits
public int streamBits()Get the total number of bits needed to writeout the stream used to create this table.- Returns:
- The number of bits
-
getEntry
-
writeDict
Write the dictionary.- Parameters:
dos
- The stream to write to.- Throws:
IOException
-
readDict
Read the dictIonary from a stream.- Parameters:
dis
- The stream.- Throws:
IOException
-
decode
public void decode(byte[] tags, int[] data) Decode a tag into a HuffmanNode.- Parameters:
tags
- The huffman tagdata
- An array to put the decoded node into
-
clear
public void clear()Clear this HuffmanTable instance. -
computeTags
public void computeTags()Compute optimized tags for each position, color, and normal entry. -
print
public void print()Print the contents of this instance to standard out.
-