Java ByteBuffer Concatenate concat(ByteBuffer[] buf1, ByteBuffer[] buf2)

Here you can find the source of concat(ByteBuffer[] buf1, ByteBuffer[] buf2)

Description

concat

License

Open Source License

Declaration

public static ByteBuffer[] concat(ByteBuffer[] buf1, ByteBuffer[] buf2) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    public static ByteBuffer[] concat(ByteBuffer[] buf1, ByteBuffer[] buf2) {
        ByteBuffer[] buf = new ByteBuffer[buf1.length + buf2.length];
        int j = 0;
        for (int i = 0, len = buf1.length; i < len; i++) {
            buf[j++] = buf1[i];//from  ww w. j a  va  2  s.  co m
        }
        for (int i = 0, len = buf2.length; i < len; i++) {
            buf[j++] = buf2[i];
        }
        return buf;
    }
}

Related

  1. concat(byte[] pre, ByteBuffer bbuf)
  2. concat(ByteBuffer b1, ByteBuffer b2)
  3. concat(ByteBuffer outPart1, ByteBuffer outPart2)
  4. concat(ByteBuffer[] buffers, ByteBuffer buffer)
  5. concat(ByteBuffer[] buffers, int overAllCapacity)
  6. concat(List bbs)
  7. concatenateBytebuffers(ArrayList buffers)