com.itextpdf.xmp.impl
Class XMPSerializerHelper

java.lang.Object
  extended by com.itextpdf.xmp.impl.XMPSerializerHelper

public class XMPSerializerHelper
extends Object

Serializes the XMPMeta-object to an OutputStream according to the SerializeOptions.

Since:
11.07.2006

Constructor Summary
XMPSerializerHelper()
           
 
Method Summary
static void serialize(XMPMetaImpl xmp, OutputStream out, SerializeOptions options)
          Static method to serialize the metadata object.
static byte[] serializeToBuffer(XMPMetaImpl xmp, SerializeOptions options)
          Serializes an XMPMeta-object as RDF into a byte buffer.
static String serializeToString(XMPMetaImpl xmp, SerializeOptions options)
          Serializes an XMPMeta-object as RDF into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMPSerializerHelper

public XMPSerializerHelper()
Method Detail

serialize

public static void serialize(XMPMetaImpl xmp,
                             OutputStream out,
                             SerializeOptions options)
                      throws XMPException
Static method to serialize the metadata object. For each serialisation, a new XMPSerializer instance is created, either XMPSerializerRDF or XMPSerializerPlain so thats its possible to serialialize the same XMPMeta objects in two threads.

Parameters:
xmp - a metadata implementation object
out - the output stream to serialize to
options - serialization options, can be null for default.
Throws:
XMPException

serializeToString

public static String serializeToString(XMPMetaImpl xmp,
                                       SerializeOptions options)
                                throws XMPException
Serializes an XMPMeta-object as RDF into a string. Note: Encoding is forced to UTF-16 when serializing to a string to ensure the correctness of "exact packet size".

Parameters:
xmp - a metadata implementation object
options - Options to control the serialization (see SerializeOptions).
Returns:
Returns a string containing the serialized RDF.
Throws:
XMPException - on serializsation errors.

serializeToBuffer

public static byte[] serializeToBuffer(XMPMetaImpl xmp,
                                       SerializeOptions options)
                                throws XMPException
Serializes an XMPMeta-object as RDF into a byte buffer.

Parameters:
xmp - a metadata implementation object
options - Options to control the serialization (see SerializeOptions).
Returns:
Returns a byte buffer containing the serialized RDF.
Throws:
XMPException - on serializsation errors.


Copyright © 2014. All Rights Reserved.