Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
hhblaze committed Jun 4, 2018
1 parent 72a48a3 commit 9def046
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 15 deletions.
7 changes: 4 additions & 3 deletions Biser/Decoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,23 @@ void GetCollection<K, V>(Func<K> fk, Func<V> fv, IDictionary<K, V> dict, IList<K
}

collectionLength = (int)((uint)this.rootDecoder.GetDigit());
if(collectionLength == 0)
if (collectionLength == 0) //JS not noted change
{
collectionIsFinished = true;
return;
}
collectionPos = 0;
collectionShift = 0;
collectionShiftToPass = 0;

int cp = this.rootDecoder.encPos;

if (this.rootDecoder.qb > 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;
Expand Down
Binary file modified Biser/bin/Debug/Biser.dll
Binary file not shown.
Binary file modified Biser/bin/Release-NET47/Biser.dll
Binary file not shown.
Binary file modified Biser/bin/Release/Biser.dll
Binary file not shown.
35 changes: 25 additions & 10 deletions BiserTest_Net/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,35 @@ static void Main(string[] args)

Biser.Encoder en2 = new Biser.Encoder();
en2.Add((int)12);
List<int> lst1 = new List<int>();
lst1.Add(1);
lst1.Add(2);
lst1.Add(3);
en2.Add(lst1, r => { en2.Add(r); });
Dictionary<string, byte[]> dic1 = new Dictionary<string, byte[]>();
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<int> lst1 = new List<int>();
//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<int> lst = de2.CheckNull() ? null : new List<int>();
if (lst != null)
//List<int> lst = de2.CheckNull() ? null : new List<int>();
//if (lst != null)
//{
// de2.GetCollection(() => { return de2.GetInt(); }, lst, true);
// foreach (var item in lst)
// Debug.WriteLine(item);
//}
Dictionary<string, byte[]> dic = de2.CheckNull() ? null : new Dictionary<string, byte[]>();
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;
Expand Down
Binary file modified BiserTest_Net/bin/Debug/Biser.dll
Binary file not shown.
Binary file modified BiserTest_Net/bin/Debug/BiserTest_Net.exe
Binary file not shown.
Binary file modified Biser_Standard/bin/Release/netstandard2.0/Biser.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Deployment/!!!Biser.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>Biser</id>
<version>1.4.0</version>
<version>1.5.0</version>
<title>Biser.NET dotnet binary serializer</title>
<authors>Alex Solovyov</authors>
<owners>tiesky.com / Alex Solovyov</owners>
Expand Down
Binary file added Deployment/Biser.1.5.0.nupkg
Binary file not shown.
2 changes: 1 addition & 1 deletion js/Biser/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 9def046

Please sign in to comment.