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 TypeMethodDescriptionvoidclear()Clear this HuffmanTable instance.voidCompute optimized tags for each position, color, and normal entry.voiddecode(byte[] tags, int[] data) Decode a tag into a HuffmanNode.getEntry(HuffmanNode node) voidprint()Print the contents of this instance to standard out.voidreadDict(InputStream dis) Read the dictIonary from a stream.voidsetDataLength(int dataLength) Set the length of each data element in bits.intGet the total number of bits needed to writeout the stream used to create this table.voidWrite 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.
-