What is the easy way to concatenate two byte arrays?
byte
Say,
byte a[]; byte b[];
How do I concatenate two byte
If you prefer ByteBuffer like @kalefranz, there is always the posibility to concatenate two byte[] (or even more) in one line, like this:
ByteBuffer
byte[]
byte[] c = ByteBuffer.allocate(a.length+b.length).put(a).put(b).array();