| java.lang.Object sun.security.util.BitArray
BitArray | public class BitArray (Code) | | A packed array of booleans.
author: Joshua Bloch author: Douglas Hoover version: 1.7 02/02/00 |
Constructor Summary | |
public | BitArray(int length) Creates a BitArray of the specified size, initialized to zeros. | public | BitArray(int length, byte[] a) Creates a BitArray of the specified size, initialized from the
specified byte array. | public | BitArray(boolean[] bits) Create a BitArray whose bits are those of the given array
of Booleans. |
Method Summary | |
public Object | clone() | public boolean | equals(Object obj) | public boolean | get(int index) Returns the indexed bit in this BitArray. | public int | hashCode() Returns a hash code value for this bit array. | public int | length() Returns the length of this BitArray. | public void | set(int index, boolean value) Sets the indexed bit in this BitArray. | public boolean[] | toBooleanArray() Return a boolean array with the same bit values a this BitArray. | public byte[] | toByteArray() Returns a Byte array containing the contents of this BitArray.
The bit stored at index zero in this BitArray will be copied
into the most significant bit of the zeroth element of the
returned byte array. | public String | toString() Returns a string representation of this BitArray. |
BitArray | public BitArray(int length, byte[] a) throws IllegalArgumentException(Code) | | Creates a BitArray of the specified size, initialized from the
specified byte array. The most significant bit of a[0] gets
index zero in the BitArray. The array a must be large enough
to specify a value for every bit in the BitArray. In other words,
8*a.length <= length.
|
BitArray | public BitArray(boolean[] bits)(Code) | | Create a BitArray whose bits are those of the given array
of Booleans.
|
hashCode | public int hashCode()(Code) | | Returns a hash code value for this bit array.
a hash code value for this bit array. |
length | public int length()(Code) | | Returns the length of this BitArray.
|
toBooleanArray | public boolean[] toBooleanArray()(Code) | | Return a boolean array with the same bit values a this BitArray.
|
toByteArray | public byte[] toByteArray()(Code) | | Returns a Byte array containing the contents of this BitArray.
The bit stored at index zero in this BitArray will be copied
into the most significant bit of the zeroth element of the
returned byte array. The last byte of the returned byte array
will be contain zeros in any bits that do not have corresponding
bits in the BitArray. (This matters only if the BitArray's size
is not a multiple of 8.)
|
toString | public String toString()(Code) | | Returns a string representation of this BitArray.
|
|
|