示例#1
0
        public static object readPlist(Stream stream, plistType type)
        {
            object obj;

            if (type == plistType.Auto)
            {
                type = Plist.getPlistType(stream);
                stream.Seek((long)0, SeekOrigin.Begin);
            }
            if (type != plistType.Binary)
            {
                XmlDocument xmlDocument = new XmlDocument()
                {
                    XmlResolver = null
                };
                xmlDocument.Load(stream);
                return(Plist.readXml(xmlDocument));
            }
            using (BinaryReader binaryReader = new BinaryReader(stream))
            {
                obj = Plist.readBinary(binaryReader.ReadBytes((int)binaryReader.BaseStream.Length));
            }
            return(obj);
        }