Package gov.nih.mipav.model.file
Class MetadataExtractor.BplistReader
java.lang.Object
gov.nih.mipav.model.file.MetadataExtractor.BplistReader
- Enclosing class:
MetadataExtractor
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 ClassesModifier and TypeClassDescriptionstatic classprivate static classA data structure to hold the BPLIST trailer data. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidhandleData(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, ArrayList<Object> objects) private static voidhandleDict(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, ArrayList<Object> objects) private static voidhandleInt(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, ArrayList<Object> objects) static booleanisValid(byte[] bplist) Ensure that a BPLIST is valid.parse(byte[] bplist) private static MetadataExtractor.BplistReader.TrailerreadTrailer(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 Details
-
PLIST_DTD
- See Also:
-
BPLIST_HEADER
private static final byte[] BPLIST_HEADER
-
-
Constructor Details
-
BplistReader
public BplistReader()
-
-
Method Details
-
isValid
public static boolean isValid(byte[] bplist) Ensure that a BPLIST is valid. -
parse
public static MetadataExtractor.BplistReader.PropertyListResults parse(byte[] bplist) throws IOException - Throws:
IOException
-
handleInt
private static void handleInt(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, ArrayList<Object> objects) throws IOException - Throws:
IOException
-
handleDict
private static void handleDict(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, ArrayList<Object> objects) throws IOException - Throws:
IOException
-
handleData
private static void handleData(int objectIndex, byte marker, MetadataExtractor.SequentialByteArrayReader reader, ArrayList<Object> objects) throws IOException - Throws:
IOException
-
readTrailer
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:
IOException
-