// Path: src/main/java/uk/org/okapibarcode/util/Arrays.java
// public static int[] insertArray(int[] original, int index, int[] inserted) {
//     int[] modified = new int[original.length + inserted.length];
//     System.arraycopy(original, 0, modified, 0, index);
//     System.arraycopy(inserted, 0, modified, index, inserted.length);
//     System.arraycopy(original, index, modified, index + inserted.length, modified.length - index - inserted.length);
//     return modified;
// }


import static java.nio.charset.StandardCharsets.US_ASCII;
import static uk.org.okapibarcode.util.Arrays.insertArray;

    }

    @Override
    protected boolean gs1Supported() {
        return true;
    }

    @Override
    protected void encode() {

        int layers;
        boolean compact;
        StringBuilder adjustedString;

        if (inputDataType == DataType.GS1 && readerInit) {
            throw new OkapiException("Cannot encode in GS1 and Reader Initialisation mode at the same time");
        }

        eciProcess(); // Get ECI mode

        /* Optional structured append (Section 8 of spec) */
        /* ML + UL start flag handled later, not part of data */
        if (structuredAppendTotal != 1) {
            StringBuilder prefix = new StringBuilder();
            if (structuredAppendMessageId != null) {
                prefix.append(' ').append(structuredAppendMessageId).append(' ');
            }
            prefix.append((char) (structuredAppendPosition + 64)); // 1-26 as A-Z
            prefix.append((char) (structuredAppendTotal + 64)); // 1-26 as A-Z
            int[] prefixArray = toBytes(prefix.toString(), US_ASCII);

// Path: src/main/java/uk/org/okapibarcode/util/Arrays.java
// public static int[] insertArray(int[] original, int index, int[] inserted) {
//     int[] modified = new int[original.length + inserted.length];
//     System.arraycopy(original, 0, modified, 0, index);
//     System.arraycopy(inserted, 0, modified, index, inserted.length);
//     System.arraycopy(original, index, modified, index + inserted.length, modified.length - index - inserted.length);
//     return modified;
// }


// Path: src/main/java/uk/org/okapibarcode/backend/AztecCode.java
import static java.nio.charset.StandardCharsets.US_ASCII;
import static uk.org.okapibarcode.util.Arrays.insertArray;

    }

    @Override
    protected boolean gs1Supported() {
        return true;
    }

    @Override
    protected void encode() {

        int layers;
        boolean compact;
        StringBuilder adjustedString;

        if (inputDataType == DataType.GS1 && readerInit) {
            throw new OkapiException("Cannot encode in GS1 and Reader Initialisation mode at the same time");
        }

        eciProcess(); // Get ECI mode

        /* Optional structured append (Section 8 of spec) */
        /* ML + UL start flag handled later, not part of data */
        if (structuredAppendTotal != 1) {
            StringBuilder prefix = new StringBuilder();
            if (structuredAppendMessageId != null) {
                prefix.append(' ').append(structuredAppendMessageId).append(' ');
            }
            prefix.append((char) (structuredAppendPosition + 64)); // 1-26 as A-Z
            prefix.append((char) (structuredAppendTotal + 64)); // 1-26 as A-Z
            int[] prefixArray = toBytes(prefix.toString(), US_ASCII);

            inputData = insertArray(inputData, 0, prefixArray);
