com.gcapmedia.dab.epg.binary
Class BitBuilder

java.lang.Object
  extended by com.gcapmedia.dab.epg.binary.BitBuilder

public class BitBuilder
extends java.lang.Object


Constructor Summary
BitBuilder(int size)
          Create a new bithelper
 
Method Summary
 boolean get(int index)
          Returns the value of the bit with the specified index
 int position()
           
static java.lang.String printByteArray(byte[] bytes)
          Returns a byte array as printable output
 BitBuilder put(int index, boolean flag)
           
 BitBuilder put(int index, byte bite)
           
 BitBuilder put(int index, int length, byte[] bytes)
           
 BitBuilder put(int index, int length, long value)
           
 void setSize(int size)
          Set a new size for the result
 int size()
          Returns the size of the construct
 byte[] toByteArray()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitBuilder

public BitBuilder(int size)
Create a new bithelper

Parameters:
size -
Method Detail

setSize

public void setSize(int size)
Set a new size for the result

Parameters:
size -

size

public int size()
Returns the size of the construct

Returns:
the size of the construct

get

public boolean get(int index)
Returns the value of the bit with the specified index

Parameters:
index - the bit index
Returns:
the value of the bit with the specified index

put

public BitBuilder put(int index,
                      int length,
                      long value)
Parameters:
index -
length -
value -

put

public BitBuilder put(int index,
                      byte bite)

put

public BitBuilder put(int index,
                      boolean flag)

put

public BitBuilder put(int index,
                      int length,
                      byte[] bytes)

toByteArray

public byte[] toByteArray()
Returns:
Returns the contents of the builder as a byte array

printByteArray

public static java.lang.String printByteArray(byte[] bytes)
Returns a byte array as printable output

Parameters:
bytes - Byte array to print

position

public int position()
Returns:
Returns the position marker as the index after the last inserted position

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2007. All Rights Reserved.