Class 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
    • Field Detail

      • BPLIST_HEADER

        private static final byte[] BPLIST_HEADER
    • Constructor Detail

      • BplistReader

        public BplistReader()
    • Method Detail

      • isValid

        public static boolean isValid​(byte[] bplist)
        Ensure that a BPLIST is valid.
      • 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