private GenericGifBlock readGenericGifBlock(final InputStream is, final int code, final byte[] first) throws IOException {
        final List<byte[]> subBlocks = new ArrayList<>();

        if (first != null) {
            subBlocks.add(first);
        }

        while (true) {
            final byte[] bytes = readSubBlock(is);
            if (bytes.length < 1) {
                break;
            }
            subBlocks.add(bytes);
        }

        return new GenericGifBlock(code, subBlocks);
    }
Extracts embedded XML metadata as XML string.
<p>

@param byteSource File containing image data.
@param params     Map of optional parameters, defined in ImagingConstants.
@return Xmp Xml as String, if present. Otherwise, returns null.
src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java