Class BitUnpacker
java.lang.Object
org.web3d.vrml.export.compressors.BitUnpacker
UnPack a stream of integers of variables bits from a packed form.
Loosely copied from Johnathon Blow's "Packing Integers" article.
- Version:
- $Revision: 1.3 $
- Author:
- Alan Hudson
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BitUnpacker
public BitUnpacker(byte[] buffer) Construct a bit unpacker.- Parameters:
buffer
- The buffer to decode.
-
-
Method Details
-
unpack
public int unpack(int num_bits) Unpack a number of bits.- Parameters:
num_bits
-- Returns:
-
reset
public void reset(byte[] buffer) Set this bit unpacker to a new value. Resets the position to the beginning.- Parameters:
buffer
-
-
getNumBitsRemaining
public long getNumBitsRemaining()Get the number of bits remaining to be processed.- Returns:
- The number of bits left to process.
-
main
-