Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


oracle.dss.util.xdo.template.flash
Class BitsReader

java.lang.Object
  extended by oracle.dss.util.xdo.template.flash.BitsReader

Direct Known Subclasses:
SWFReader

public class BitsReader
extends java.lang.Object

Read bits from a specified byte array Bit position is like this. 0000000 | | | +-- position(7) +-------- position(0) Example: BitsReader br = new BitsReader( data, 0, 0 ); int val = br.readBits( 5 ); // Read first 5 bits int val2 = br.readBits( 10 ); // Read next 10 bits ...


Field Summary
protected  int mBitPos
           
protected  int mBytePos
           
protected  byte[] mData
           

 

Constructor Summary
BitsReader(byte[] data, int bytePos, int bitPos)
           

 

Method Summary
 int getBitPosition()
           
 int getBytePosition()
           
static int readBits(byte data, int startBit, int endBit)
          Read bits within a byte.
 int readBits(int numBits)
          Read specified bits from the current position.
static int readBits(int data, int startBit, int endBit)
          Read bits within an int.
 void skipFilledBits()
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

mData

protected byte[] mData

mBytePos

protected int mBytePos

mBitPos

protected int mBitPos

Constructor Detail

BitsReader

public BitsReader(byte[] data,
                  int bytePos,
                  int bitPos)

Method Detail

readBits

public int readBits(int numBits)
Read specified bits from the current position. The current position will be moved after this operation.
Parameters:
numBits - number of bits (must be <=32)
Returns:
value

readBits

public static int readBits(byte data,
                           int startBit,
                           int endBit)
Read bits within a byte. Bit position is like this. 0000000 | | | +-- position(7) +-------- position(0)
Parameters:
data -
start - start bit position (0-7)
end - end bit position (0-7)
Returns:

readBits

public static int readBits(int data,
                           int startBit,
                           int endBit)
Read bits within an int.
Parameters:
data -
startBit -
endBit -
Returns:

skipFilledBits

public void skipFilledBits()

getBytePosition

public int getBytePosition()

getBitPosition

public int getBitPosition()

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


Copyright © 1997, 2009, Oracle. All rights reserved.