Class BitBuilder

java.lang.Object
org.bouncycastle.oer.BitBuilder

public class BitBuilder extends Object
  • Constructor Details

    • BitBuilder

      public BitBuilder()
  • Method Details

    • writeBit

      public BitBuilder writeBit(int bit)
      write a bit
      Parameters:
      bit - where 0 = 0 bit and not zero is 1 bit.
      Returns:
    • writeBits

      public BitBuilder writeBits(long value, int start)
    • writeBits

      public BitBuilder writeBits(long value, int start, int len)
    • write

      public int write(OutputStream outputStream) throws IOException
      Deprecated.
      the builder is left holding the octets it has just written, including a final octet that further bits would go on filling, so a second write re-emits them; use writeAndClear(OutputStream), which writes the same octets and resets the builder.
      Write the octets holding the bits so far, the last one padded with zero bits, and keep them.
      Throws:
      IOException
    • writeAndClear

      public int writeAndClear(OutputStream outputStream) throws IOException
      Throws:
      IOException
    • pad

      public void pad()
      Advance to the next octet boundary without writing; the skipped bits are already zero.
    • write7BitBytes

      public void write7BitBytes(int value)
      Write value as the subsequent octets of a CHOICE tag, X.696 sec. 8.7.2.3: seven bits per octet, most significant group first, in the fewest octets that hold the value (so the first group is never all zero), with bit 8 set on every octet but the last. A negative argument is taken as its unsigned 32-bit value.
    • write7BitBytes

      public void write7BitBytes(BigInteger value)
      As write7BitBytes(int), for a non-negative value of any size.
    • zero

      public void zero()