public class ByteList extends Object
Constructor and Description |
---|
ByteList()
Create a new ByteList of default starting size.
|
ByteList(int startSize)
Create a new ByteList of a specified starting size.
|
Modifier and Type | Method and Description |
---|---|
void |
add(byte b)
Add a byte to the end of this ByteList.
|
byte[] |
asArray()
Get an array of all the bytes added to this ByteList.
|
void |
clear()
Clear this ByteList of all added bytes.
|
byte |
get(int i)
Get a byte at a specified index in this ByteList.
|
int |
size()
Get the number of bytes that have been added to this ByteList.
|
public ByteList()
public ByteList(int startSize)
startSize
- the desired start size for the backing arraypublic void add(byte b)
b
- the byte to addpublic byte get(int i)
i
- the index of the byte to getpublic int size()
public byte[] asArray()
public void clear()