Class Hierarchy Previous Next Index
java.lang.Object | +----COM.cloudscape.util.BitUtil
This class provides some basic static methods for manipulating a Cloudscape BIT or BIT VARYING field as a packed vector of booleans. It is modeled after some methods in the java.util.BitSet class. An alternative to using a SQL BIT (VARYING) column in conjunction with the methods provided herein to provide bit manipulation would be to use a serialized java.util.BitSet column instead.
This class contains the following static methods:
Since these methods effectively allow a SQL BIT to be considered as an array of booleans, all offsets (position parameters) are zero based. So if you want to set the first bit of a BIT type, you would use set(MyBitColumn, 0) .
Examples:
public BitUtil()
public static byte[] set(byte bytes[], int position)
bytes
- the byte array
position
- the bit to set, starting from zero
public static byte[] clear(byte bytes[], int position)
bytes
- the byte array
position
- the bit to clear, starting from zero
public static boolean get(byte bytes[], int position)
bytes
- the byte array
position
- the bit to check, starting from zero
Class Hierarchy Previous Next Index