Bouncy Castle Cryptography Library 1.47

org.bouncycastle.crypto.engines
Class IndexGenerator.BitString

java.lang.Object
  extended by org.bouncycastle.crypto.engines.IndexGenerator.BitString
Enclosing class:
IndexGenerator

public static class IndexGenerator.BitString
extends java.lang.Object

Represents a string of bits and supports appending, reading the head, and reading the tail.


Constructor Summary
IndexGenerator.BitString()
           
 
Method Summary
 void appendBits(byte b)
          Appends all bits in a byte to the end of the bit string.
 byte[] getBytes()
           
 int getLeadingAsInt(int numBits)
          Returns up to 32 bits from the beginning of the bit string.
 IndexGenerator.BitString getTrailing(int numBits)
          Returns the last numBits bits from the end of the bit string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexGenerator.BitString

public IndexGenerator.BitString()
Method Detail

appendBits

public void appendBits(byte b)
Appends all bits in a byte to the end of the bit string.

Parameters:
b - a byte

getTrailing

public IndexGenerator.BitString getTrailing(int numBits)
Returns the last numBits bits from the end of the bit string.

Parameters:
numBits - number of bits
Returns:
a new BitString of length numBits

getLeadingAsInt

public int getLeadingAsInt(int numBits)
Returns up to 32 bits from the beginning of the bit string.

Parameters:
numBits - number of bits
Returns:
an int whose lower numBits bits are the beginning of the bit string

getBytes

public byte[] getBytes()

Bouncy Castle Cryptography Library 1.47