public class FlexFec03BitSet
extends java.lang.Object
Constructor and Description |
---|
FlexFec03BitSet(int numBits)
Ctor
|
Modifier and Type | Method and Description |
---|---|
void |
addBit(int bitIndex,
boolean bitValue)
Add a bit with the given value in the given position.
|
void |
clear(int bitIndex)
Clear the bit (set to 0) at the given index
|
boolean |
get(int bitIndex)
Get the bit at the given index
|
void |
removeBit(int bitIndex)
Remove a bit from the given position.
|
void |
set(int bitIndex)
Set the bit (set to 1) at the given index
|
int |
sizeBits()
Get the size of this set, in bits
|
int |
sizeBytes()
Get the size of this set, in bytes
|
byte[] |
toByteArray()
Writes this bitset to a byte array, where the rightmost bit is treated
as the least significant bit.
|
java.lang.String |
toString()
Print the bitmask in a manner where the left-most bit is the LSB
|
static FlexFec03BitSet |
valueOf(byte[] bytes)
Parse the value of the given byte buffer into the bitset
|
static FlexFec03BitSet |
valueOf(byte[] bytes,
int offset,
int length)
Parse the given bytes (at the given offset and length) into a
FlexFec03BitSet
|
public FlexFec03BitSet(int numBits)
numBits
- the size, in bits, of this setpublic void set(int bitIndex)
bitIndex
- public boolean get(int bitIndex)
bitIndex
- public void clear(int bitIndex)
bitIndex
- public void addBit(int bitIndex, boolean bitValue)
bitIndex
- the index at which to insert the bitbitValue
- the value to set on the inserted bitpublic void removeBit(int bitIndex)
bitIndex
- public static FlexFec03BitSet valueOf(byte[] bytes)
bytes
- public static FlexFec03BitSet valueOf(byte[] bytes, int offset, int length)
bytes
- the byte buffer to parseoffset
- the offset at which to start parsinglength
- the length (in bytes) of the chunk to parsepublic int sizeBytes()
public int sizeBits()
public byte[] toByteArray()
public java.lang.String toString()
toString
in class java.lang.Object
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.