net.sourceforge.jwap.util
Class BitArrayOutputStream

java.lang.Object
  |
  +--net.sourceforge.jwap.util.BitArrayOutputStream

public class BitArrayOutputStream
extends java.lang.Object


Field Summary
static boolean debug
           
 
Constructor Summary
BitArrayOutputStream()
           
 
Method Summary
 void flush(boolean fill)
          fills up the aktual byte with bits "0" for fill = false and "1" for fill = true
static java.util.BitSet getBitSet(byte m)
          Constructs a BitSet of the byte m
static java.lang.String getBitString(byte m)
          Constructs a binary representation of the byte m
static java.lang.String getBitString(byte[] m)
          Constructs a binary representation of the byte-array m
static void main(java.lang.String[] args)
          Test method
 void reset()
           
 byte[] toByteArray()
           
 java.lang.String toString()
          constructs a string representation of the outputstream.
 void write(boolean b)
          writes a bit down to the stream.
 void write(byte[] b)
          writes count bits from byte _b beginning on the right hand.
 void write(byte _b, int count)
          writes count bits from byte _b beginning on the right hand.
 void write(int b, int count)
           
 void write(long b, int count)
          writes count bits of an integer into the stream beginning on the right hand.
 void writeUintVar(long b)
          write a unintvar according to WAP-230-WSP-10010705-a secition 8.1.2
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
Constructor Detail

BitArrayOutputStream

public BitArrayOutputStream()
Method Detail

flush

public void flush(boolean fill)
fills up the aktual byte with bits "0" for fill = false and "1" for fill = true

toByteArray

public byte[] toByteArray()

write

public void write(boolean b)
writes a bit down to the stream. is used by all the other methods in this class.

write

public void write(byte _b,
                  int count)
writes count bits from byte _b beginning on the right hand. Count has NOT to be in byte-size (e.g. 8, 16, 24, 32,...)

reset

public void reset()

write

public void write(int b,
                  int count)

write

public void write(long b,
                  int count)
writes count bits of an integer into the stream beginning on the right hand. Count has NOT to be in byte-size (e.g. 8, 16, 24, 32,...) also use it for a uint8 (use bits=8) or unit16 (use bits=16) or uint32 (use bits=32) according to WAP-230-WSP-10010705-a secition 8.1.2

writeUintVar

public void writeUintVar(long b)
                  throws java.lang.NumberFormatException
write a unintvar according to WAP-230-WSP-10010705-a secition 8.1.2

write

public void write(byte[] b)
writes count bits from byte _b beginning on the right hand. Count has NOT to be in byte-size (e.g. 8, 16, 24, 32,...)

toString

public java.lang.String toString()
constructs a string representation of the outputstream.
Overrides:
toString in class java.lang.Object

getBitString

public static java.lang.String getBitString(byte m)
Constructs a binary representation of the byte m

getBitString

public static java.lang.String getBitString(byte[] m)
Constructs a binary representation of the byte-array m

getBitSet

public static java.util.BitSet getBitSet(byte m)
Constructs a BitSet of the byte m

main

public static void main(java.lang.String[] args)
Test method