net.sf.xbus.base.bytearraylist
Class ByteArrayList

java.lang.Object
  extended by net.sf.xbus.base.bytearraylist.ByteArrayList

public class ByteArrayList
extends java.lang.Object

Manages a list of byte arrays.


Constructor Summary
ByteArrayList()
           
 
Method Summary
 void add(byte[] byteArray)
          Appends the specified byte array to the end of this list.
 void addAll(ByteArrayList list)
           
static ByteArrayList createByteArrayList(byte[] byteBuffer, int lineLength)
           
 byte[] get(int index)
           
 java.lang.String getContentAsString(java.lang.String system)
          getContentAsString returns the content of the ByteArrayList as string.
 java.util.Iterator iterator()
          Returns an iterator over the elements in this list in proper sequence.
 int length()
          Method length.
 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

ByteArrayList

public ByteArrayList()
Method Detail

getContentAsString

public java.lang.String getContentAsString(java.lang.String system)
                                    throws XException
getContentAsString returns the content of the ByteArrayList as string. Each single byte array builds up one line in the string.

Parameters:
system - used to determine the ByteArrayConverter and linebreaks
Returns:
A string containing the byte arrays in lines.
Throws:
XException - in case that the conversion cannot be performed

toString

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

add

public void add(byte[] byteArray)
Appends the specified byte array to the end of this list.

Parameters:
byteArray - byte array to be appended to this list

iterator

public java.util.Iterator iterator()
Returns an iterator over the elements in this list in proper sequence.

Returns:
an iterator over the elements in this list in proper sequence

length

public int length()
Method length.

Returns:
int

get

public byte[] get(int index)

addAll

public void addAll(ByteArrayList list)

toByteArray

public byte[] toByteArray()
Returns:
the content of the ByteArrayList as an array of bytes with system specific line breaks.

createByteArrayList

public static ByteArrayList createByteArrayList(byte[] byteBuffer,
                                                int lineLength)
                                         throws XException
Throws:
XException