I want to make a growable array of bytes. I.e a list. In c# would usally do the following syntax
List<byte> mylist = new List<byte>();
where as in java this syntax does not work and I have googled around and found the below code
List myList = new ArrayList();
but that is not what I want. Any idea's where I am going wrong?
You could also use TByteArrayList from the GNU Trove library.
Use the wrapper class Byte
:
List<Byte> mylist = new ArrayList<Byte>();
Then, because of autoboxing, you can still have:
for (byte b : mylist) {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With