private int[] getColorTable(final byte[] bytes) throws ImagingException {
        if (bytes.length % 3 != 0) {
            throw new ImagingException("Bad Color Table Length: " + bytes.length);
        }
        final int length = bytes.length / 3;

        final int[] result = Allocator.intArray(length);

        for (int i = 0; i < length; i++) {
            final int red = 0xff & bytes[i * 3 + 0];
            final int green = 0xff & bytes[i * 3 + 1];
            final int blue = 0xff & bytes[i * 3 + 2];

            final int alpha = 0xff;

            final int rgb = alpha << 24 | red << 16 | green << 8 | blue << 0;
            result[i] = rgb;
        }

        return result;
    }
See {@link GifImageParser#readBlocks} for reference how the blocks are created. They should match the code we are giving here, returning the correct
class type. Internal only.
src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java