Methods Summary |
---|
public boolean | equals(java.lang.Object obj)
if (!(obj instanceof BooleanByte))
{
return false;
}
BooleanByte object = (BooleanByte) obj;
return this.bitPosition == object.bitPosition && super.equals(obj);
|
public int | getBitPosition()
return bitPosition;
|
public int | getSize()
return 1;
|
public void | readByteArray(byte[] arr, int offset)
if (arr == null)
{
throw new NullPointerException("Byte array is null");
}
if ((offset < 0) || (offset >= arr.length))
{
throw new IndexOutOfBoundsException("Offset to byte array is out of bounds: offset = " + offset + ", array.length = " + arr.length);
}
byte newValue = arr[offset];
newValue >>= bitPosition;
newValue &= 0x1;
this.value = newValue == 1;
|
public java.lang.String | toString()
return "" + value;
|
public byte[] | writeByteArray()
byte[] retValue;
retValue = new byte[1];
if (value != null)
{
retValue[0] = (byte) ((Boolean) value ? 1 : 0);
retValue[0] <<= bitPosition;
}
return retValue;
|