Debian Codegraph @

src/com/drew/metadata/xmp/XmpWriter.java

raw symbols SCIP
1 package com.drew.metadata.xmp;
2
3 import java.io.OutputStream;
4
5 import com.adobe.internal.xmp.XMPException;
6 import com.adobe.internal.xmp.XMPMeta;
7 import com.adobe.internal.xmp.XMPMetaFactory;
8 import com.adobe.internal.xmp.options.SerializeOptions;
9 import com.drew.metadata.Metadata;
10
11 public class XmpWriter
12 {
13 /**
14 * Serializes the XmpDirectory component of <code>Metadata</code> into an <code>OutputStream</code>
15 * @param os Destination for the xmp data
16 * @param data populated metadata
17 * @return serialize success
18 */
19 public static boolean write(OutputStream os, Metadata data) throws XMPException
20 {
21 XmpDirectory dir = data.getFirstDirectoryOfType(XmpDirectory.class);
22 if (dir == null)
23 return false;
24 XMPMeta meta = dir.getXMPMeta();
25 SerializeOptions so = new SerializeOptions().setOmitPacketWrapper(true);
26 XMPMetaFactory.serialize(meta, os, so);
27 return true;
28 }
29 }