Hi I've 2 byteBuffers and I want to concatenate them together to a single byteBuffer. I found a similar question here but none of the suggestions there worked for me.
You can do it like this
ByteBuffer b3 = ByteBuffer.allocate(b1.limit() + b2.limit());
b3.put(b1);
b3.put(b2);
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