diff --git a/Biser/Decoder.cs b/Biser/Decoder.cs index bbdce8d..c2975cd 100644 --- a/Biser/Decoder.cs +++ b/Biser/Decoder.cs @@ -223,7 +223,7 @@ void GetCollection(Func fk, Func fv, IDictionary dict, IList(Func fk, Func fv, IDictionary dict, IList 1) { collectionShift = this.rootDecoder.qb - 1; collectionShiftToPass = 0; - this.rootDecoder.encPos = cp + collectionLength - 1; + //this.rootDecoder.encPos = cp + collectionLength - 1; + this.rootDecoder.encPos = cp + collectionLength - collectionShift; //JS not noted change collectionBuffer = Read(collectionShift); this.rootDecoder.encPos = cp; collectionPos += collectionShift; diff --git a/Biser/bin/Debug/Biser.dll b/Biser/bin/Debug/Biser.dll index c024aca..27820e5 100644 Binary files a/Biser/bin/Debug/Biser.dll and b/Biser/bin/Debug/Biser.dll differ diff --git a/Biser/bin/Release-NET47/Biser.dll b/Biser/bin/Release-NET47/Biser.dll index 8062f44..8d96a53 100644 Binary files a/Biser/bin/Release-NET47/Biser.dll and b/Biser/bin/Release-NET47/Biser.dll differ diff --git a/Biser/bin/Release/Biser.dll b/Biser/bin/Release/Biser.dll index 66d0c46..ceb6588 100644 Binary files a/Biser/bin/Release/Biser.dll and b/Biser/bin/Release/Biser.dll differ diff --git a/BiserTest_Net/Program.cs b/BiserTest_Net/Program.cs index 52aca01..fc2ab6e 100644 --- a/BiserTest_Net/Program.cs +++ b/BiserTest_Net/Program.cs @@ -21,20 +21,35 @@ static void Main(string[] args) Biser.Encoder en2 = new Biser.Encoder(); en2.Add((int)12); - List lst1 = new List(); - lst1.Add(1); - lst1.Add(2); - lst1.Add(3); - en2.Add(lst1, r => { en2.Add(r); }); + Dictionary dic1 = new Dictionary(); + dic1.Add("str1", new byte[] { 1, 2, 3 }); + dic1.Add("str2", new byte[] { 1, 2 }); + dic1.Add("str3", null); + dic1.Add("str4", new byte[0]); + dic1.Add("str5", new byte[] { 1, 2,3,4,5 }); + en2.Add(dic1, r => { en2.Add(r.Key); en2.Add(r.Value); }); + //List lst1 = new List(); + //lst1.Add(1); + //lst1.Add(2); + //lst1.Add(3); + //en2.Add(lst1, r => { en2.Add(r); }); en2.Add((int)14); Biser.Decoder de2 = new Biser.Decoder(en2.Encode()); Debug.WriteLine(de2.GetInt()); - List lst = de2.CheckNull() ? null : new List(); - if (lst != null) + //List lst = de2.CheckNull() ? null : new List(); + //if (lst != null) + //{ + // de2.GetCollection(() => { return de2.GetInt(); }, lst, true); + // foreach (var item in lst) + // Debug.WriteLine(item); + //} + Dictionary dic = de2.CheckNull() ? null : new Dictionary(); + if (dic != null) { - de2.GetCollection(() => { return de2.GetInt(); }, lst, true); - foreach (var item in lst) - Debug.WriteLine(item); + de2.GetCollection(() => { return de2.GetString(); }, + () => { return de2.GetByteArray(); }, dic, true); + foreach (var item in dic) + Debug.WriteLine(item.Key); } Debug.WriteLine(de2.GetInt()); return; diff --git a/BiserTest_Net/bin/Debug/Biser.dll b/BiserTest_Net/bin/Debug/Biser.dll index c024aca..3da49dc 100644 Binary files a/BiserTest_Net/bin/Debug/Biser.dll and b/BiserTest_Net/bin/Debug/Biser.dll differ diff --git a/BiserTest_Net/bin/Debug/BiserTest_Net.exe b/BiserTest_Net/bin/Debug/BiserTest_Net.exe index 22da1c9..642e8f1 100644 Binary files a/BiserTest_Net/bin/Debug/BiserTest_Net.exe and b/BiserTest_Net/bin/Debug/BiserTest_Net.exe differ diff --git a/Biser_Standard/bin/Release/netstandard2.0/Biser.dll b/Biser_Standard/bin/Release/netstandard2.0/Biser.dll index 242bc1a..cc6eb21 100644 Binary files a/Biser_Standard/bin/Release/netstandard2.0/Biser.dll and b/Biser_Standard/bin/Release/netstandard2.0/Biser.dll differ diff --git a/Deployment/!!!Biser.nuspec b/Deployment/!!!Biser.nuspec index e985351..6354209 100644 --- a/Deployment/!!!Biser.nuspec +++ b/Deployment/!!!Biser.nuspec @@ -2,7 +2,7 @@ Biser - 1.4.0 + 1.5.0 Biser.NET dotnet binary serializer Alex Solovyov tiesky.com / Alex Solovyov diff --git a/Deployment/Biser.1.5.0.nupkg b/Deployment/Biser.1.5.0.nupkg new file mode 100644 index 0000000..32cbedf Binary files /dev/null and b/Deployment/Biser.1.5.0.nupkg differ diff --git a/js/Biser/package.json b/js/Biser/package.json index ad354fb..617c0b9 100644 --- a/js/Biser/package.json +++ b/js/Biser/package.json @@ -1,6 +1,6 @@ { "name": "biser", - "version": "1.0.0", + "version": "1.5.0", "description": "Binary serializer for javascript and .NET (c# csharp dotnet)", "main": "biser.js", "scripts": {