protected ArrayList<Integer> decode(final int dataSize, final int offset) {
        final ArrayList<Integer> arrayList = new ArrayList<>();
        final int size = dataSize - offset;
        if (size == 0) {
            return arrayList;
        }
        if (size == 2) {
            final byte[] netKeyIndex = new byte[]{(byte) (mParameters[offset + 1] & 0x0F), mParameters[offset]};
            final int keyIndex = encode(netKeyIndex);
            arrayList.add(keyIndex);
        } else {
            final int firstKeyIndex = encode(new byte[]{(byte) (mParameters[offset + 1] & 0x0F), mParameters[offset]});
            final int secondNetKeyIndex = encode(new byte[]{
                    (byte) ((mParameters[offset + 2] & 0xF0) >> 4),
                    (byte) (mParameters[offset + 2] << 4 | ((mParameters[offset + 1] & 0xF0) >> 4))});
            arrayList.add(firstKeyIndex);
            arrayList.add(secondNetKeyIndex);
            arrayList.addAll(decode(dataSize, offset + 3));
        }
        return arrayList;
    }
Parses the status parameters returned by a status message
mesh/src/main/java/no/nordicsemi/android/mesh/transport/ConfigStatusMessage.java