Re: Adding to a byte array



"Brian Bagnall" <bbagnall@xxxxxxx> wrote:
What's the easiest way to append a few extra byte values to the end of an
existing byte array? Do I have to create a new larger array
Yes

and copy the old contents one by one using a for() loop?
You can use
System.arraycopy(oldArray, 0, newArray, 0, oldArray.length);
instead.

--
Thomas


.