Class BitBuilder
java.lang.Object
org.bouncycastle.oer.BitBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpad()Advance to the next octet boundary without writing; the skipped bits are already zero.intwrite(OutputStream outputStream) Deprecated.voidwrite7BitBytes(int value) Writevalueas the subsequent octets of a CHOICE tag, X.696 sec.voidwrite7BitBytes(BigInteger value) Aswrite7BitBytes(int), for a non-negative value of any size.intwriteAndClear(OutputStream outputStream) writeBit(int bit) write a bitwriteBits(long value, int start) writeBits(long value, int start, int len) voidzero()
-
Constructor Details
-
BitBuilder
public BitBuilder()
-
-
Method Details
-
writeBit
write a bit- Parameters:
bit- where 0 = 0 bit and not zero is 1 bit.- Returns:
-
writeBits
-
writeBits
-
write
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; usewriteAndClear(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
- 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) Writevalueas 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
Aswrite7BitBytes(int), for a non-negative value of any size. -
zero
public void zero()
-
writeAndClear(OutputStream), which writes the same octets and resets the builder.