krb5.lib
Class BitString

java.lang.Object
  extended by krb5.lib.BitString
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
APOptions, KDCOptions, TicketFlags

public class BitString
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Class Description : Bit String class. A modified version of the code obtained from the Open Group Research Institute.

Version:
1.1
Author:
Bojan Pajkovski
See Also:
Serialized Form

Constructor Summary
BitString(byte[] data, int new_size)
          Class constructor
BitString(int i)
          Class constructor
 
Method Summary
 void clear(int bit)
          Clears a bit
 java.lang.Object clone()
          Clones this object
 boolean get(int bit)
          Get a bit
 boolean match(BitString other, int bit)
          Check whether two BitStrings match
 void set(int bit)
          Set a bit
 int size()
          Returns size of the BitString
 byte[] toBytes()
          Converts BitString to bytes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitString

public BitString(int i)
Class constructor


BitString

public BitString(byte[] data,
                 int new_size)
          throws KrbException
Class constructor

Parameters:
data - byte[]
new_size - int
Throws:
KrbException
Method Detail

clone

public java.lang.Object clone()
Clones this object

Overrides:
clone in class java.lang.Object
Returns:
Object

clear

public void clear(int bit)
           throws KrbException
Clears a bit

Parameters:
bit - int
Throws:
KrbException

get

public boolean get(int bit)
            throws KrbException
Get a bit

Parameters:
bit - int
Returns:
boolean
Throws:
KrbException

set

public void set(int bit)
         throws KrbException
Set a bit

Parameters:
bit - int
Throws:
KrbException

size

public int size()
Returns size of the BitString

Returns:
int - size of the BitString

match

public boolean match(BitString other,
                     int bit)
              throws KrbException
Check whether two BitStrings match

Parameters:
other - BitString
bit - int
Returns:
boolean
true - BitStrings match
false - BitStrings do not match
Throws:
KrbException

toBytes

public byte[] toBytes()
               throws KrbException
Converts BitString to bytes

Returns:
byte[]
Throws:
KrbException