public class BitBuffer extends Object
Modifier and Type | Field and Description |
---|---|
private static int[] |
BACK_MASK
Deprecated.
Various bitmasks for the 0000xxxx side of a byte.
|
private byte[] |
byteBuffer
Deprecated.
|
private int |
currentBit
Deprecated.
|
private int |
currentByte
Deprecated.
|
private int |
eofByte
Deprecated.
|
private boolean |
eofFlag
Deprecated.
|
private static int[] |
FRONT_MASK
Deprecated.
Various bitmasks for the xxxx0000 side of a byte.
|
private static org.slf4j.Logger |
LOGGER
Deprecated.
|
Constructor and Description |
---|
BitBuffer(byte[] byteBuffer)
Deprecated.
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getBits(int bitsToRead)
Deprecated.
Returns an int value representing the value of the bits read from
the byte array, from the current position.
|
byte[] |
getByteBuffer()
Deprecated.
Return the backing byte array.
|
boolean |
isBitOnByteBoundary()
Deprecated.
Checks if the current position is on a byte boundary, that is the next
bit in the byte array is the first bit in a byte.
|
static void |
main(String[] args)
Deprecated.
Testing method.
|
void |
skipBits(long bits)
Deprecated.
Skips a number of bits in the BitBuffer.
|
private static final org.slf4j.Logger LOGGER
private static final int[] BACK_MASK
private static final int[] FRONT_MASK
private byte[] byteBuffer
private int currentByte
private int currentBit
private int eofByte
private boolean eofFlag
public byte[] getByteBuffer()
public void skipBits(long bits)
bits
- Number of bits to skippublic int getBits(int bitsToRead)
The current position is modified by this call.
Bits are pushed into the int from the right, endianness is not considered by the method on its own. So, if 5 bits were read from the buffer "10101", the int would be the integer representation of 000...0010101 on the target machine.
In general, this also means the result will be positive unless a full 32 bits are read.
Requesting more than 32 bits is allowed, but only up to 32 bits worth of data will be returned (the last 32 bits read).
bitsToRead
- the number of bits to read from the bit bufferpublic boolean isBitOnByteBoundary()
public static void main(String[] args)
args
- Ignored.Copyright © 2017 Open Microscopy Environment