public static byte[] join(byte[] separator, byte[]... components) {
        if (components == null || components.length == 0) {
            return new byte[0];
        }

        int finalSize = 0;
        if (separator != null) {
            finalSize = separator.length * (components.length - 1);
        }
        for (byte[] comp : components) {
            finalSize += comp.length;
        }

        byte[] buf = new byte[finalSize];
        int offset = 0;
        for (int i = 0; i < components.length; i++) {
            System.arraycopy(components[i], 0, buf, offset, components[i].length);
            offset += components[i].length;
            if (i < (components.length - 1) && separator != null && separator.length > 0) {
                System.arraycopy(separator, 0, buf, offset, separator.length);
                offset += separator.length;
            }
        }
        return buf;
    }
Returns a single byte array containing all of the individual component arrays separated by
the separator array.
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/utils/ByteUtil.java