Package org.yamcs.utils
Class ByteArray
- java.lang.Object
-
- org.yamcs.utils.ByteArray
-
public class ByteArray extends Object
byte array
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_CAPACITY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(byte x)add value to the arrayvoidadd(int pos, byte x)byte[]array()get the backing arraybooleanequals(Object obj)byteget(int pos)get element at positioninthashCode()intindexOf(byte x)Returns the index of the first occurrence of the specified element in the array, or -1 if the array does not contain the element.booleanisEmpty()voidset(int pos, byte x)intsize()byte[]toArray()StringtoString()static ByteArraywrap(byte... array)Creates the IntArray with the backing array
-
-
-
Method Detail
-
wrap
public static ByteArray wrap(byte... array)
Creates the IntArray with the backing array- Parameters:
array-- Returns:
- a new object containing all the values from the passed array
-
add
public void add(byte x)
add value to the array- Parameters:
x- - value to be added
-
add
public void add(int pos, byte x)
-
get
public byte get(int pos)
get element at position- Parameters:
pos-- Returns:
- the element at the specified position
-
isEmpty
public boolean isEmpty()
-
toArray
public byte[] toArray()
-
size
public int size()
-
set
public void set(int pos, byte x)
-
indexOf
public int indexOf(byte x)
Returns the index of the first occurrence of the specified element in the array, or -1 if the array does not contain the element.- Parameters:
x- element which is searched for- Returns:
- the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
-
array
public byte[] array()
get the backing array- Returns:
- the backing array
-
-