Re: Adding to a byte array
- From: "Thomas Fritsch" <i.dont.like.spam@xxxxxxxxxxx>
- Date: Sat, 26 Aug 2006 20:15:16 +0200
"Brian Bagnall" <bbagnall@xxxxxxx> wrote:
What's the easiest way to append a few extra byte values to the end of anYes
existing byte array? Do I have to create a new larger array
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
.
- Follow-Ups:
- Re: Adding to a byte array
- From: Brian Bagnall
- Re: Adding to a byte array
- References:
- Adding to a byte array
- From: Brian Bagnall
- Adding to a byte array
- Prev by Date: Adding to a byte array
- Next by Date: Re: Memory Allocation in Java
- Previous by thread: Adding to a byte array
- Next by thread: Re: Adding to a byte array
- Index(es):