public class IMFUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static javax.xml.datatype.XMLGregorianCalendar |
createXMLGregorianCalendar()
A utility method to create an XMLGregorianCalendar
|
static byte[] |
generateHashAndBase64Encode(java.io.File file)
A method that generates a SHA-256 hash of the file and Base64 encode the result.
|
static java.lang.String |
generateTimecodeStartAddress()
A method that generates a CPL schema valid TimecodeStartAddress string
|
static <T extends org.smpte_ra.schemas.st2067_2_2013.BaseResourceType> |
safeCast(org.smpte_ra.schemas.st2067_2_2013.BaseResourceType baseResourceType,
java.lang.Class<T> cls)
A method to cast the object that was passed in to the specified subclass safely
|
static void |
writeCPLToFile(org.smpte_ra.schemas.st2067_2_2013.CompositionPlaylistType compositionPlaylistType,
java.io.File outputFile)
A utility method that writes out the serialized IMF CPL document to a file
|
@Nullable public static javax.xml.datatype.XMLGregorianCalendar createXMLGregorianCalendar()
public static java.lang.String generateTimecodeStartAddress()
public static byte[] generateHashAndBase64Encode(java.io.File file) throws java.io.IOException
file
- - the file whose SHA-256 hash is to be generatedjava.io.IOException
- - any I/O related error will be exposed through an IOExceptionpublic static <T extends org.smpte_ra.schemas.st2067_2_2013.BaseResourceType> T safeCast(org.smpte_ra.schemas.st2067_2_2013.BaseResourceType baseResourceType, java.lang.Class<T> cls) throws IMFException
T
- the type of BaseResourcebaseResourceType
- - the object that needs to cast to the subclass of this typecls
- the Class for the casted typeIMFException
- - a class cast failure is exposed through an IMFExceptionpublic static void writeCPLToFile(org.smpte_ra.schemas.st2067_2_2013.CompositionPlaylistType compositionPlaylistType, java.io.File outputFile) throws java.io.IOException
compositionPlaylistType
- an instance of the composition playlist typeoutputFile
- the file that the serialized XML is written tojava.io.IOException
- - any I/O related error will be exposed through an IOException