Class CodeInputUnpacker

java.lang.Object
org.web3d.vrml.export.compressors.CodeInputUnpacker

public class CodeInputUnpacker extends Object
Unpacks N bit codes from source bytes, provided as either an array or stream. N may be more or less than (or equal) to 8 bits, and may be as much as 16 bits, and of course must be what was actually packed.

Since code width N may be greater than 8, unpacked codes are always returned as ints. Packing order as shown for some widths:

 Width = 12 x 2 codes = 8 x 3
 |BA987654|
 |3210/BA98|
 |76543210|
 Width = 10 x 4 codes = 8 x 5
 |98765432|
 |10/987654|
 |3210/9876|
 |543210/98|
 |76543210|
 Width = 8,
 |76543210|
 Width = 7 x 8 codes = 8 x 7
 |6543210/6|
 |543210/65|
 |43210/654|
 |3210/6543|
 |210/65432|
 |10/654321|
 |0/6543210|
 Width = 6 x 4 codes = 8 x 3
 |543210/54|
 |3210/5432|
 |10/543210|
 
counter
Version:
$Revision: 1.2 $