Class ByteArrayList

java.lang.Object
com.semedy.reasoner.utils.ByteArrayList

public class ByteArrayList extends Object
List for bytes based on arrays
Author:
juergen
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(byte i)
    add a new element
    boolean
    add(byte[] b)
    add a new element
    boolean
    add(byte[] b, int off, int len)
    add a new element
    void
    append(byte b)
    append list by one byte b
    void
    append a byte array list at the end
    void
    clear list
    byte
    get(int i)
    get element at index i
    boolean
    remove(int i)
    remove an element from list
    void
    set(int i, byte value)
    replace element at index i by value
    void
    set(int i, byte[] b, int off, int len)
    replace elements starting at index i by len values
    int
    get the size of the list
    int
    get the size of the list in bytes
    byte[]
    returns the base array without copying it
    This means also, that there can be irrelevant information at the end.
    byte[]
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteArrayList

      public ByteArrayList()
  • Method Details

    • sizeInBytes

      public int sizeInBytes()
      get the size of the list in bytes
      Returns:
    • add

      public boolean add(byte i) throws IOException
      add a new element
      Parameters:
      i - , the element to add
      Returns:
      has element been added
      Throws:
      IOException
    • add

      public boolean add(byte[] b) throws IOException
      add a new element
      Parameters:
      b - , the element to add
      Returns:
      has element been added
      Throws:
      IOException
    • add

      public boolean add(byte[] b, int off, int len) throws IOException
      add a new element
      Parameters:
      b - , the element to add
      off - , at offset
      len - , with length len
      Returns:
      has element been added
      Throws:
      IOException
    • remove

      public boolean remove(int i)
      remove an element from list
      Parameters:
      i - , element to be removed
      Returns:
      element has been removed
    • get

      public byte get(int i)
      get element at index i
      Parameters:
      i -
      Returns:
    • set

      public void set(int i, byte value)
      replace element at index i by value
      Parameters:
      i - , index
      value - , new value
    • set

      public void set(int i, byte[] b, int off, int len)
      replace elements starting at index i by len values
      Parameters:
      i - , index
      b - , the new elemtns
      off - , at offset
      len - with length len
    • size

      public int size()
      get the size of the list
      Returns:
    • clear

      public void clear()
      clear list
    • append

      public void append(ByteArrayList L) throws IOException
      append a byte array list at the end
      Parameters:
      L - , list to append
      Throws:
      IOException
    • append

      public void append(byte b) throws IOException
      append list by one byte b
      Parameters:
      b -
      Throws:
      IOException
    • toArray

      public byte[] toArray()
      returns the base array without copying it
      This means also, that there can be irrelevant information at the end.
      Returns:
    • toByteArray

      public byte[] toByteArray()