Package gov.nih.mipav.model.file
Class MetadataExtractor.BplistReader
- java.lang.Object
-
- gov.nih.mipav.model.file.MetadataExtractor.BplistReader
-
- Enclosing class:
- MetadataExtractor
public static class MetadataExtractor.BplistReader extends java.lang.Object
A limited-functionality binary property list (BPLIST) utility. Parser functionality accounts for "dict" (with simple integer and string values) and "data". https://opensource.apple.com/source/CF/CF-550/ForFoundationOnly.h https://opensource.apple.com/source/CF/CF-550/CFBinaryPList.c https://synalysis.com/how-to-decode-apple-binary-property-list-files/- Author:
- Bob Johnson
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetadataExtractor.BplistReader.PropertyListResults
private static class
MetadataExtractor.BplistReader.Trailer
A data structure to hold the BPLIST trailer data.
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
BPLIST_HEADER
private static java.lang.String
PLIST_DTD
-
Constructor Summary
Constructors Constructor Description BplistReader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
handleData(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, java.util.ArrayList<java.lang.Object> objects)
private static void
handleDict(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, java.util.ArrayList<java.lang.Object> objects)
private static void
handleInt(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, java.util.ArrayList<java.lang.Object> objects)
static boolean
isValid(byte[] bplist)
Ensure that a BPLIST is valid.static MetadataExtractor.BplistReader.PropertyListResults
parse(byte[] bplist)
private static MetadataExtractor.BplistReader.Trailer
readTrailer(byte[] bplist)
Given a full byte array containing the BPLIST, read the trailer object from the end of the array. 5 unused bytes and 1 sort version are skipped.
-
-
-
Field Detail
-
PLIST_DTD
private static final java.lang.String PLIST_DTD
- See Also:
- Constant Field Values
-
BPLIST_HEADER
private static final byte[] BPLIST_HEADER
-
-
Method Detail
-
isValid
public static boolean isValid(byte[] bplist)
Ensure that a BPLIST is valid.
-
parse
public static MetadataExtractor.BplistReader.PropertyListResults parse(byte[] bplist) throws java.io.IOException
- Throws:
java.io.IOException
-
handleInt
private static void handleInt(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, java.util.ArrayList<java.lang.Object> objects) throws java.io.IOException
- Throws:
java.io.IOException
-
handleDict
private static void handleDict(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, java.util.ArrayList<java.lang.Object> objects) throws java.io.IOException
- Throws:
java.io.IOException
-
handleData
private static void handleData(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, java.util.ArrayList<java.lang.Object> objects) throws java.io.IOException
- Throws:
java.io.IOException
-
readTrailer
private static MetadataExtractor.BplistReader.Trailer readTrailer(byte[] bplist) throws java.io.IOException
Given a full byte array containing the BPLIST, read the trailer object from the end of the array. 5 unused bytes and 1 sort version are skipped.- Parameters:
bplist
- The BPLIST binary array.- Returns:
- Returns the Trailer object with values parsed from the array.
- Throws:
java.io.IOException
-
-