From b4974acba9bb1c20cd0ec591d17a403fcdeb9b9e Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Fri, 25 Nov 2016 17:44:27 +0100 Subject: [PATCH] Don't reuse object IDs for NSNumber objects Make the constructors and Write methods public --- plist-cil/BinaryPropertyListWriter.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plist-cil/BinaryPropertyListWriter.cs b/plist-cil/BinaryPropertyListWriter.cs index ca7adcb..5ea1ae7 100644 --- a/plist-cil/BinaryPropertyListWriter.cs +++ b/plist-cil/BinaryPropertyListWriter.cs @@ -188,18 +188,18 @@ namespace Claunia.PropertyList /// /// The output stream into which the binary property list will be written /// If an error occured while writing to the stream - BinaryPropertyListWriter(Stream outStr) + public BinaryPropertyListWriter(Stream outStr) { outStream = outStr; } - BinaryPropertyListWriter(Stream outStr, int version) + public BinaryPropertyListWriter(Stream outStr, int version) { this.version = version; outStream = outStr; } - void Write(NSObject root) + public void Write(NSObject root) { // magic bytes Write(new[] { (byte)'b', (byte)'p', (byte)'l', (byte)'i', (byte)'s', (byte)'t' }); @@ -287,7 +287,7 @@ namespace Claunia.PropertyList // If binary compatibility with the Apple format is required, // UID, NSArray and NSString objects are assigned a new ID, // even if they already exist in the file. - if (!this.ReuseObjectIds && (obj is UID || obj is NSArray)) + if (!this.ReuseObjectIds && (obj is UID || obj is NSNumber || obj is NSArray)) { idMap.Add(obj); }