public final class BitUtil extends Object implements Serializable
(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl/language
License of use: Lesser
General Public License (LGPL) , no warranty
Modifier and Type | Method and Description |
---|---|
static BitSet |
fromBoolean(boolean value)
returns a one-size BitSet with value
|
static BitSet |
fromByteArray(byte[] bytes) |
static BitSet |
fromInt(int value,
int length)
returns the bitset of an integer value
|
static BitSet |
fromInteger(Integer value,
int length)
returns the bitset of an integer value
|
static BitSet |
fromString(String value)
constructs a new BitSet from a string in the "110110" format.
|
static byte[] |
toByteArray(BitSet bits) |
static int |
toInt(BitSet bits,
int length) |
public static byte[] toByteArray(BitSet bits)
bits
- the bitset to convertpublic static int toInt(BitSet bits, int length)
bits
- the bitset to convertlength
- the length of the setpublic static BitSet fromString(String value)
value
- the valuepublic static BitSet fromByteArray(byte[] bytes)
bytes
- the byteArraypublic static BitSet fromInt(int value, int length)
value
- the valuelength
- the length of the bitSet to producepublic static BitSet fromInteger(Integer value, int length)
value
- the valuelength
- the length ofpublic static BitSet fromBoolean(boolean value)
value
- the value of the bitSetCopyright © 2002-2012 Delft University of Technology, the Netherlands. All Rights Reserved.