问题
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.
回答1:
You can do it like this
ByteBuffer b3 = ByteBuffer.allocate(b1.limit() + b2.limit());
b3.put(b1);
b3.put(b2);
来源:https://stackoverflow.com/questions/30734268/concatenate-two-bytebuffers-to-a-single