Answers for "how to comibine two byte arrays java"

0

java combine to byte

byte[] one = getBytesForOne();
byte[] two = getBytesForTwo();

List<Byte> list = new ArrayList<Byte>(Arrays.<Byte>asList(one));
list.addAll(Arrays.<Byte>asList(two));

byte[] combined = list.toArray(new byte[list.size()]);
Posted by: Guest on January-01-1970
0

java combine to byte

byte[] one = getBytesForOne();
byte[] two = getBytesForTwo();
byte[] combined = new byte[one.length + two.length];

for (int i = 0; i < combined.length; ++i)
{
    combined[i] = i < one.length ? one[i] : two[i - one.length];
}
Posted by: Guest on January-01-1970

Code answers related to "how to comibine two byte arrays java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language