@@ -0,0 +1,1697 @@
+package com.google.android.libraries.motionphotoreader;%0A%0Aimport androidx.annotation.Nullable;%0A%0Aimport com.adobe.internal.xmp.XMPException;%0Aimport com.adobe.internal.xmp.XMPMeta;%0Aimport com.adobe.internal.xmp.XMPMetaFactory;%0Aimport com.google.common.io.ByteStreams;%0Aimport com.google.common.primitives.Bytes;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0Aimport java.util.Arrays;%0A%0A/**%0A * The XmpParser class is a package-private class intended to help extract the microvideo offset%0A * information from the XMP metadata of the given Motion Photo. This class is for internal use only.%0A */%0Aclass XmpParser %7B%0A%0A    private static final byte%5B%5D OPEN_ARR = %22%3Cx:xmpmeta%22.getBytes();  /* Start of XMP metadata tag */%0A    private static final byte%5B%5D CLOSE_ARR = %22%3C/x:xmpmeta%3E%22.getBytes();  /* End of XMP metadata tag */%0A%0A    /**%0A     * Returns the metadata of the Motion Photo file.%0A     */%0A    @Nullable%0A    public static XMPMeta getXmpMetadata(String filename) throws IOException, XMPException %7B%0A        try (FileInputStream in = new FileInputStream(filename)) %7B%0A            ByteArrayOutputStream out = new ByteArrayOutputStream();%0A            ByteStreams.copy(in, out);%0A%0A            byte%5B%5D fileData = out.toByteArray();%0A%0A            int openIdx = Bytes.indexOf(fileData, OPEN_ARR);%0A            if (openIdx %3E= 0) %7B%0A                int closeIdx = Bytes.indexOf(Arrays.copyOfRange(fileData, openIdx, fileData.length), CLOSE_ARR) + openIdx + CLOSE_ARR.length;%0A%0A                byte%5B%5D segArr = Arrays.copyOfRange(fileData, openIdx, closeIdx);%0A                return XMPMetaFactory.parseFromBuffer(segArr);%0A            %7D%0A        %7D%0A        return null;%0A    %7D%0A%7D

Add XmpParser.java