private List<ImageResourceBlock> readImageResourceBlocks(final ByteSource byteSource, final int[] imageResourceIDs, final int maxBlocksToRead)
            throws ImagingException, IOException {
        try (InputStream imageStream = byteSource.getInputStream();
                InputStream resourceStream = getInputStream(byteSource, PSD_SECTION_IMAGE_RESOURCES)) {
            final PsdImageContents imageContents = readImageContents(imageStream);
            final byte[] ImageResources = BinaryFunctions.readBytes("ImageResources", resourceStream, imageContents.imageResourcesLength,
                    "Not a Valid PSD File");
            return readImageResourceBlocks(ImageResources, imageResourceIDs, maxBlocksToRead);
        }
    }
Extracts embedded XML metadata as XML string.

@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/psd/PsdImageParser.java