uk.me.parabola.imgfmt.app
Class BitReader

java.lang.Object
  extended by uk.me.parabola.imgfmt.app.BitReader

public class BitReader
extends java.lang.Object

Author:
Steve Ratcliffe

Constructor Summary
BitReader(byte[] buf)
           
 
Method Summary
 int get(int n)
           
 boolean get1()
           
 int getBitPosition()
           
 int sget2(int n)
          Get a signed n-bit value, treating 1 << (n-1) as a flag to read another signed n-bit value for extended range (mysteriously only in the negative direction).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitReader

public BitReader(byte[] buf)
Method Detail

get1

public boolean get1()

get

public int get(int n)

sget2

public int sget2(int n)
Get a signed n-bit value, treating 1 << (n-1) as a flag to read another signed n-bit value for extended range (mysteriously only in the negative direction). At least two levels of recursion show up in the wild; current code computes correctly in that example.


getBitPosition

public int getBitPosition()