private byte[] appendPdu(final int mtuSize, final byte[] pdu) {
        final int length = Math.min(pdu.length, mtuSize);
        if (mIncomingBuffer == null) {
            mIncomingBufferOffset = 0;
            mIncomingBufferOffset += length;
            mIncomingBuffer = pdu;
        } else {
            final byte[] buffer = new byte[mIncomingBuffer.length + length];
            System.arraycopy(mIncomingBuffer, 0, buffer, 0, mIncomingBufferOffset);
            System.arraycopy(pdu, 0, buffer, mIncomingBufferOffset, length);
            mIncomingBufferOffset += length;
            mIncomingBuffer = buffer;
            final int sar = MeshParserUtils.unsignedByteToInt(pdu[0]) >> SAR_BIT_OFFSET;
            if (sar == GATT_SAR_END) {
                final byte[] packet = mIncomingBuffer;
                mIncomingBuffer = null;
                return packet;
            }
        }
        return null;
    }
Appends the PDUs that are segmented at gatt layer.

@param mtuSize mtu size supported by the device/node
@param pdu     pdu received by the provisioner
@return the combine pdu or returns null if not complete.
mesh/src/main/java/no/nordicsemi/android/mesh/MeshManagerApi.java