diff --git a/DBreeze.NetCoreApp/DBreeze.NetCoreApp.csproj b/DBreeze.NetCoreApp/DBreeze.NetCoreApp.csproj
index 0859ee8e..beab110e 100644
--- a/DBreeze.NetCoreApp/DBreeze.NetCoreApp.csproj
+++ b/DBreeze.NetCoreApp/DBreeze.NetCoreApp.csproj
@@ -6,9 +6,9 @@
DBreeze
True
signature.snk
- 1.094.2019.0609
- 1.094.2019.0619
- 1.094.2019.0619
+ 1.095.2019.0812
+ 1.095.2019.0812
+ 1.095.2019.0812
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.deps.json b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.deps.json
index 5c545974..4d58df64 100644
--- a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.deps.json
+++ b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.deps.json
@@ -6,7 +6,7 @@
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v1.0": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"runtime": {
"DBreeze.dll": {}
}
@@ -14,7 +14,7 @@
}
},
"libraries": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.dll b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.dll
index 74517a51..e05c9df3 100644
Binary files a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.dll and b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.dll differ
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.pdb b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.pdb
index fe41f735..48a11c30 100644
Binary files a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.pdb and b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.0/DBreeze.pdb differ
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.deps.json b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.deps.json
index 5da5341f..d3ae260d 100644
--- a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.deps.json
+++ b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.deps.json
@@ -6,7 +6,7 @@
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v1.1": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"runtime": {
"DBreeze.dll": {}
}
@@ -14,7 +14,7 @@
}
},
"libraries": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.dll b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.dll
index 78800bbb..b5910e70 100644
Binary files a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.dll and b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.dll differ
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.pdb b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.pdb
index fe41f735..48a11c30 100644
Binary files a/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.pdb and b/DBreeze.NetCoreApp/bin/Release/netcoreapp1.1/DBreeze.pdb differ
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.deps.json b/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.deps.json
index 056aaccc..26db4ecc 100644
--- a/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.deps.json
+++ b/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.deps.json
@@ -6,7 +6,7 @@
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v2.0": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"runtime": {
"DBreeze.dll": {}
}
@@ -14,7 +14,7 @@
}
},
"libraries": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.dll b/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.dll
index 594147f0..25530e66 100644
Binary files a/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.dll and b/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.dll differ
diff --git a/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.pdb b/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.pdb
index 6ce787ce..57e7f060 100644
Binary files a/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.pdb and b/DBreeze.NetCoreApp/bin/Release/netcoreapp2.0/DBreeze.pdb differ
diff --git a/DBreeze.NetStandard/DBreeze.NetStandard.csproj b/DBreeze.NetStandard/DBreeze.NetStandard.csproj
index 5d3febfb..114d5308 100644
--- a/DBreeze.NetStandard/DBreeze.NetStandard.csproj
+++ b/DBreeze.NetStandard/DBreeze.NetStandard.csproj
@@ -9,9 +9,9 @@
DBreeze
- 1.094.2019.0609
- 1.094.2019.0609
- 1.094.2019.0609
+ 1.095.2019.0812
+ 1.094.2019.0812
+ 1.095.2019.0812
diff --git a/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.deps.json b/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.deps.json
index 8a6856e4..03469929 100644
--- a/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.deps.json
+++ b/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.deps.json
@@ -7,7 +7,7 @@
"targets": {
".NETStandard,Version=v1.6": {},
".NETStandard,Version=v1.6/": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"dependencies": {
"NETStandard.Library": "1.6.1"
},
@@ -821,7 +821,7 @@
}
},
"libraries": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.dll b/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.dll
index 8fc141ab..86bfb4ee 100644
Binary files a/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.dll and b/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.dll differ
diff --git a/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.pdb b/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.pdb
index 54147522..ff301efd 100644
Binary files a/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.pdb and b/DBreeze.NetStandard/bin/Release/netstandard1.6/DBreeze.pdb differ
diff --git a/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.deps.json b/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.deps.json
index 5f5c914c..88b9c156 100644
--- a/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.deps.json
+++ b/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.deps.json
@@ -7,7 +7,7 @@
"targets": {
".NETStandard,Version=v2.0": {},
".NETStandard,Version=v2.0/": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"dependencies": {
"NETStandard.Library": "2.0.3"
},
@@ -24,7 +24,7 @@
}
},
"libraries": {
- "DBreeze/1.094.2019.0609": {
+ "DBreeze/1.095.2019.0812": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.dll b/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.dll
index cbabb278..bf2fb293 100644
Binary files a/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.dll and b/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.dll differ
diff --git a/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.pdb b/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.pdb
index 7b500bd4..be099715 100644
Binary files a/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.pdb and b/DBreeze.NetStandard/bin/Release/netstandard2.0/DBreeze.pdb differ
diff --git a/DBreeze/Properties/AssemblyInfo.cs b/DBreeze/Properties/AssemblyInfo.cs
index 2d4b13b4..963e724c 100644
--- a/DBreeze/Properties/AssemblyInfo.cs
+++ b/DBreeze/Properties/AssemblyInfo.cs
@@ -39,5 +39,5 @@
// [assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.061.2013.1120")]
//[assembly: AssemblyFileVersion("1.061.2013.1120")]
-[assembly: AssemblyVersion("1.094.2019.0609")]
-[assembly: AssemblyFileVersion("1.094.2019.0609")]
+[assembly: AssemblyVersion("1.095.2019.0812")]
+[assembly: AssemblyFileVersion("1.095.2019.0812")]
diff --git a/DBreeze/Utils/BiserDecoder.cs b/DBreeze/Utils/BiserDecoder.cs
index af2acf4d..4b8ae80f 100644
--- a/DBreeze/Utils/BiserDecoder.cs
+++ b/DBreeze/Utils/BiserDecoder.cs
@@ -37,10 +37,40 @@ public Decoder(byte[] encoded)
}
- ulong GetDigit() //Gets next digit from the byte[] stream, this function works only from root decoder
+ //ulong GetDigit() //Gets next digit from the byte[] stream, this function works only from root decoder
+ //{
+ // int shift = 0;
+ // ulong result = 0;
+ // ulong byteValue = 0;
+ // qb = 0;
+
+ // while (true)
+ // {
+
+ // if (coldeepcnt > 0 && !coldeep[coldeepcnt-1].collectionIsFinished && coldeep[coldeepcnt-1].collectionShiftToPass < coldeep[coldeepcnt-1].collectionShift)
+ // {
+ // byteValue = coldeep[coldeepcnt-1].collectionBuffer[coldeep[coldeepcnt-1].collectionShiftToPass++];
+ // }
+ // else
+ // {
+ // encPos++;
+ // byteValue = (ulong)encoded[encPos]; //Automatically will throw exception in case if index is out of range
+ // }
+
+ // result |= (byteValue & 0x7f) << shift;
+ // qb++;
+ // if ((byteValue & 0x80) != 0x80)
+ // return result;
+
+ // shift += 7;
+ // }
+ //}
+
+ bool GetDigit(out ulong result) //Gets next digit from the byte[] stream, this function works only from root decoder
{
int shift = 0;
- ulong result = 0;
+ //ulong result = 0;
+ result = 0;
ulong byteValue = 0;
qb = 0;
@@ -54,13 +84,20 @@ public Decoder(byte[] encoded)
else
{
encPos++;
+
+ if (encPos >= encoded.Length) //enhancing property
+ return false;
+
byteValue = (ulong)encoded[encPos]; //Automatically will throw exception in case if index is out of range
}
result |= (byteValue & 0x7f) << shift;
qb++;
if ((byteValue & 0x80) != 0x80)
- return result;
+ {
+ return true;
+ //return result;
+ }
shift += 7;
}
@@ -71,6 +108,10 @@ public Decoder(byte[] encoded)
byte[] Read(int length)
{
this.encPos++;
+
+ if (encPos >= this.encoded.Length)
+ return null;
+
byte[] bt = new byte[length];
Buffer.BlockCopy(this.encoded, this.encPos, bt, 0, length);
this.encPos += length - 1;
@@ -83,7 +124,10 @@ byte[] Read(int length)
/// true if null
public bool CheckNull()
{
- return !(this.GetDigit() == 0);
+ if (!this.GetDigit(out var dig))
+ return true;
+ return !(dig == 0);
+ //return !(this.GetDigit() == 0);
}
///
@@ -96,63 +140,70 @@ public IEnumerable GetCollection(bool isNullChecked = false)
ulong prot = 0;
if (!isNullChecked)
- prot = this.GetDigit();
-
- if (prot == 0)
{
+ if (!this.GetDigit(out prot))
+ prot = 1;
- int collectionLength = (int)this.GetDigit();
+ //prot = this.GetDigit();
+ }
- if (collectionLength > 0) //JS not noted change
+ if (prot == 0)
+ {
+ if (this.GetDigit(out prot))
{
- coldeepcnt++;
-
- int cp = this.encPos;
+ int collectionLength = (int)prot;
+ //int collectionLength = (int)this.GetDigit();
- ch cdi = null;
- if (coldeep.Count < coldeepcnt)
+ if (collectionLength > 0) //JS not noted change
{
- cdi = new ch();
- coldeep.Add(cdi);
- }
- else
- cdi = coldeep[coldeepcnt - 1];
+ coldeepcnt++;
- if (this.qb > 1)
- {
- cdi.collectionShiftToPass = 0;
- cdi.collectionShift = this.qb - 1;
- this.encPos = cp + collectionLength - cdi.collectionShift; //JS not noted change
- cdi.collectionBuffer = Read(cdi.collectionShift);
- this.encPos = cp;
- }
- else
- {
- cdi.collectionShift = 0;
- cdi.collectionShiftToPass = 0;
- }
+ int cp = this.encPos;
+ ch cdi = null;
+ if (coldeep.Count < coldeepcnt)
+ {
+ cdi = new ch();
+ coldeep.Add(cdi);
+ }
+ else
+ cdi = coldeep[coldeepcnt - 1];
- cdi.collectionIsFinished = false;
+ if (this.qb > 1)
+ {
+ cdi.collectionShiftToPass = 0;
+ cdi.collectionShift = this.qb - 1;
+ this.encPos = cp + collectionLength - cdi.collectionShift; //JS not noted change
+ cdi.collectionBuffer = Read(cdi.collectionShift);
+ this.encPos = cp;
+ }
+ else
+ {
+ cdi.collectionShift = 0;
+ cdi.collectionShiftToPass = 0;
+ }
- while (!cdi.collectionIsFinished)
- {
- yield return this;
+ cdi.collectionIsFinished = false;
- if ((this.encPos - (cp - cdi.collectionShift)) == collectionLength)
+ while (!cdi.collectionIsFinished)
{
- cdi.collectionIsFinished = true;
- if (cdi.collectionShift > 0)
- this.encPos += cdi.collectionShift;
- coldeepcnt--;
- break;
+ yield return this;
+
+ if ((this.encPos - (cp - cdi.collectionShift)) == collectionLength)
+ {
+ cdi.collectionIsFinished = true;
+ if (cdi.collectionShift > 0)
+ this.encPos += cdi.collectionShift;
+
+ coldeepcnt--;
+ break;
+ }
}
}
}
-
}
@@ -212,72 +263,84 @@ class ch
ulong prot = 0;
if (!isNullChecked)
- prot = this.GetDigit();
+ {
+ if (!this.GetDigit(out prot))
+ prot = 1;
+
+ //prot = this.GetDigit();
+ }
if (prot == 0)
{
- int collectionLength = (int)this.GetDigit();
- if (collectionLength == 0) //JS not noted change
+ if (this.GetDigit(out prot))
{
- return;
- }
-
- coldeepcnt++;
-
- int cp = this.encPos;
+ int collectionLength = (int)prot;
+ //int collectionLength = (int)this.GetDigit();
- ch cdi = null;
- if (coldeep.Count < coldeepcnt)
- {
- cdi = new ch();
- coldeep.Add(cdi);
- }
- else
- cdi = coldeep[coldeepcnt - 1];
+ if (collectionLength == 0) //JS not noted change
+ {
+ return;
+ }
- if (this.qb > 1)
- {
- cdi.collectionShiftToPass = 0;
- cdi.collectionShift = this.qb - 1;
- this.encPos = cp + collectionLength - cdi.collectionShift; //JS not noted change
- cdi.collectionBuffer = Read(cdi.collectionShift);
- this.encPos = cp;
- //collectionPos += collectionShift;
- }
- else
- {
- cdi.collectionShift = 0;
- cdi.collectionShiftToPass = 0;
- }
+ coldeepcnt++;
+ int cp = this.encPos;
- cdi.collectionIsFinished = false;
+ ch cdi = null;
+ if (coldeep.Count < coldeepcnt)
+ {
+ cdi = new ch();
+ coldeep.Add(cdi);
+ }
+ else
+ cdi = coldeep[coldeepcnt - 1];
- while (true)
- {
- if (dict == null)
+ if (this.qb > 1)
{
- if (lst == null)
- set.Add(fk());
- else
- lst.Add(fk());
+ cdi.collectionShiftToPass = 0;
+ cdi.collectionShift = this.qb - 1;
+ this.encPos = cp + collectionLength - cdi.collectionShift; //JS not noted change
+ cdi.collectionBuffer = Read(cdi.collectionShift);
+ this.encPos = cp;
+ //collectionPos += collectionShift;
}
else
- dict.Add(fk(), fv());
+ {
+ cdi.collectionShift = 0;
+ cdi.collectionShiftToPass = 0;
+ }
- if ((this.encPos - (cp - cdi.collectionShift)) == collectionLength)
+ cdi.collectionIsFinished = false;
+
+ while (true)
{
- cdi.collectionIsFinished = true;
- if (cdi.collectionShift > 0)
- this.encPos += cdi.collectionShift;
+ if (dict == null)
+ {
+ if (lst == null)
+ set.Add(fk());
+ else
+ lst.Add(fk());
+ }
+ else
+ dict.Add(fk(), fv());
- coldeepcnt--;
- break;
+ if ((this.encPos - (cp - cdi.collectionShift)) == collectionLength)
+ {
+ cdi.collectionIsFinished = true;
+ if (cdi.collectionShift > 0)
+ this.encPos += cdi.collectionShift;
+
+ coldeepcnt--;
+
+ break;
+ }
}
}
+
+
}
@@ -286,12 +349,18 @@ class ch
public DateTime GetDateTime()
{
- return new DateTime(Biser.DecodeZigZag(this.GetDigit()));
+ if (!this.GetDigit(out var dgt))
+ return default(DateTime);
+
+ return new DateTime(Biser.DecodeZigZag(dgt));
}
public DateTime? GetDateTime_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetDateTime();
}
@@ -299,12 +368,18 @@ public DateTime GetDateTime()
public long GetLong()
{
- return Biser.DecodeZigZag(this.GetDigit());
+ if (!this.GetDigit(out var dgt))
+ return default(long);
+
+ return Biser.DecodeZigZag(dgt);
}
public long? GetLong_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetLong();
@@ -312,72 +387,109 @@ public long GetLong()
public ulong GetULong()
{
- return this.GetDigit();
+ if (!this.GetDigit(out var dgt))
+ return default(ulong);
+
+ return dgt;
}
public ulong? GetULong_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetULong();
}
public int GetInt()
{
- return (int)Biser.DecodeZigZag(this.GetDigit());
+ if (!this.GetDigit(out var dgt))
+ return default(int);
+
+ return (int)Biser.DecodeZigZag(dgt);
}
public int? GetInt_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetInt();
}
public uint GetUInt()
{
- return (uint)this.GetDigit();
+ if (!this.GetDigit(out var dgt))
+ return default(uint);
+
+ return (uint)dgt;
}
public uint? GetUInt_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetUInt();
}
public short GetShort()
{
- return (short)Biser.DecodeZigZag(this.GetDigit());
+ if (!this.GetDigit(out var dgt))
+ return default(short);
+
+ return (short)Biser.DecodeZigZag(dgt);
}
public short? GetShort_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetShort();
}
public ushort GetUShort()
{
- return (ushort)Biser.DecodeZigZag(this.GetDigit());
+ if (!this.GetDigit(out var dgt))
+ return default(ushort);
+
+ return (ushort)Biser.DecodeZigZag(dgt);
}
public ushort? GetUShort_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetUShort();
}
public bool GetBool()
{
- return Read(1)[0] == 1;
+ var bt = Read(1);
+ if (bt == null)
+ return default(bool);
+ return bt[0] == 1;
+ //return Read(1)[0] == 1;
}
public bool? GetBool_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetBool();
@@ -385,52 +497,80 @@ public bool GetBool()
public sbyte GetSByte()
{
- return (sbyte)Read(1)[0];
+ var bt = Read(1);
+ if (bt == null)
+ return default(sbyte);
+ return (sbyte)bt[0];
+
+ //return (sbyte)Read(1)[0];
}
public sbyte? GetSByte_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetSByte();
}
public byte GetByte()
{
- return Read(1)[0];
+ var bt = Read(1);
+ if (bt == null)
+ return default(byte);
+ return bt[0];
+
+ //return Read(1)[0];
}
public byte? GetByte_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetByte();
}
public float GetFloat()
{
- var subRet = this.GetDigit();
+ if (!this.GetDigit(out var dgt))
+ return default(float);
+
+ var subRet = dgt;
var ret = BitConverter.ToSingle(BitConverter.GetBytes(subRet), 0);
return ret;
}
public float? GetFloat_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetFloat();
}
public double GetDouble()
{
- var subRet = this.GetDigit();
+ if (!this.GetDigit(out var dgt))
+ return default(double);
+
+ var subRet = dgt;
var ret = BitConverter.ToDouble(BitConverter.GetBytes(subRet), 0);
return ret;
}
public double? GetDouble_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetDouble();
@@ -438,17 +578,26 @@ public double GetDouble()
public decimal GetDecimal()
{
+ if (!this.GetDigit(out var dgt))
+ return default(decimal);
+
int[] bits = new int[4];
- bits[0] = (int)Biser.DecodeZigZag(this.GetDigit());
- bits[1] = (int)Biser.DecodeZigZag(this.GetDigit());
- bits[2] = (int)Biser.DecodeZigZag(this.GetDigit());
- bits[3] = (int)Biser.DecodeZigZag(this.GetDigit());
+ bits[0] = (int)Biser.DecodeZigZag(dgt);
+ this.GetDigit(out dgt);
+ bits[1] = (int)Biser.DecodeZigZag(dgt);
+ this.GetDigit(out dgt);
+ bits[2] = (int)Biser.DecodeZigZag(dgt);
+ this.GetDigit(out dgt);
+ bits[3] = (int)Biser.DecodeZigZag(dgt);
return new decimal(bits);
}
public decimal? GetDecimal_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetDecimal();
}
@@ -460,7 +609,10 @@ public char GetChar()
public char? GetChar_NULL()
{
- if (this.GetDigit() == 1)
+ if (!this.GetDigit(out var dgt))
+ return null;
+
+ if (dgt == 1)
return null;
return GetChar();
@@ -483,7 +635,10 @@ public string GetString()
///
public long JSGetLong()
{
- return Biser.DecodeZigZag(this.GetDigit());
+ if (!this.GetDigit(out var dgt))
+ return default(long);
+
+ return Biser.DecodeZigZag(dgt);
}
///
@@ -517,6 +672,8 @@ public string JSGetString()
public double JSGetDouble()
{
var bt = this.Read(9);
+ if (bt == null)
+ return default(double);
if (BitConverter.IsLittleEndian ^ (bt[0] == 0))
Array.Reverse(bt, 1, 8);
@@ -530,7 +687,10 @@ public DateTime JSGetDate()
public bool JSGetBool()
{
- return this.Read(1)[0] == 1;
+ var bt = Read(1);
+ if (bt == null)
+ return true;
+ return bt[0] == 1;
}
public byte[] JSGetByteArray()
@@ -552,14 +712,19 @@ public byte[] GetByteArray()
//0 - with length, 1 - null, 2 - zero length
byte[] ret = null;
- var prot = this.GetDigit();
+ if (!this.GetDigit(out var prot))
+ return null;
+
+ //var prot = this.GetDigit();
switch (prot)
{
case 2:
ret = new byte[0];
break;
case 0:
- ret = Read((int)((uint)this.GetDigit()));
+ this.GetDigit(out prot);
+ ret = Read((int)((uint)prot));
+ //ret = Read((int)((uint)this.GetDigit()));
break;
}
diff --git a/Deployment/Nuget/Actual/DBreeze.actual.nupkg b/Deployment/Nuget/Actual/DBreeze.actual.nupkg
index 276001af..4545ed12 100644
Binary files a/Deployment/Nuget/Actual/DBreeze.actual.nupkg and b/Deployment/Nuget/Actual/DBreeze.actual.nupkg differ
diff --git a/Deployment/Nuget/DBreeze.1.95.0.nupkg b/Deployment/Nuget/DBreeze.1.95.0.nupkg
new file mode 100644
index 00000000..af4d23a3
Binary files /dev/null and b/Deployment/Nuget/DBreeze.1.95.0.nupkg differ
diff --git a/Deployment/bin/DBreeze_1_094_2019_0609_ULTIMATE.zip b/Deployment/bin/DBreeze_1_095_2019_0812_ULTIMATE.zip
similarity index 51%
rename from Deployment/bin/DBreeze_1_094_2019_0609_ULTIMATE.zip
rename to Deployment/bin/DBreeze_1_095_2019_0812_ULTIMATE.zip
index 0eee96e4..03bf440a 100644
Binary files a/Deployment/bin/DBreeze_1_094_2019_0609_ULTIMATE.zip and b/Deployment/bin/DBreeze_1_095_2019_0812_ULTIMATE.zip differ
diff --git a/Deployment/bin/NET35/DBreeze.dll b/Deployment/bin/NET35/DBreeze.dll
index 2b102b4c..86cb1aee 100644
Binary files a/Deployment/bin/NET35/DBreeze.dll and b/Deployment/bin/NET35/DBreeze.dll differ
diff --git a/Deployment/bin/NET35/DBreeze_1_094_2019_0609_NET35_Win.zip b/Deployment/bin/NET35/DBreeze_1_094_2019_0609_NET35_Win.zip
deleted file mode 100644
index cbf75dc4..00000000
Binary files a/Deployment/bin/NET35/DBreeze_1_094_2019_0609_NET35_Win.zip and /dev/null differ
diff --git a/Deployment/bin/NET35/DBreeze_1_095_2019_0812_NET35_Win.zip b/Deployment/bin/NET35/DBreeze_1_095_2019_0812_NET35_Win.zip
new file mode 100644
index 00000000..3570a42c
Binary files /dev/null and b/Deployment/bin/NET35/DBreeze_1_095_2019_0812_NET35_Win.zip differ
diff --git a/Deployment/bin/NET40/DBreeze.dll b/Deployment/bin/NET40/DBreeze.dll
index 2da14519..8f98261d 100644
Binary files a/Deployment/bin/NET40/DBreeze.dll and b/Deployment/bin/NET40/DBreeze.dll differ
diff --git a/Deployment/bin/NET40/DBreeze_1_094_2019_0609_NET40_MONO.zip b/Deployment/bin/NET40/DBreeze_1_094_2019_0609_NET40_MONO.zip
deleted file mode 100644
index 98ba344a..00000000
Binary files a/Deployment/bin/NET40/DBreeze_1_094_2019_0609_NET40_MONO.zip and /dev/null differ
diff --git a/Deployment/bin/NET40/DBreeze_1_095_2019_0812_NET40_MONO.zip b/Deployment/bin/NET40/DBreeze_1_095_2019_0812_NET40_MONO.zip
new file mode 100644
index 00000000..b7715f58
Binary files /dev/null and b/Deployment/bin/NET40/DBreeze_1_095_2019_0812_NET40_MONO.zip differ
diff --git a/Deployment/bin/NET45/DBreeze.dll b/Deployment/bin/NET45/DBreeze.dll
index 07fde4d7..44bf4467 100644
Binary files a/Deployment/bin/NET45/DBreeze.dll and b/Deployment/bin/NET45/DBreeze.dll differ
diff --git a/Deployment/bin/NET45/DBreeze_1_094_2019_0609_NET45_MONO.zip b/Deployment/bin/NET45/DBreeze_1_094_2019_0609_NET45_MONO.zip
deleted file mode 100644
index 348ab487..00000000
Binary files a/Deployment/bin/NET45/DBreeze_1_094_2019_0609_NET45_MONO.zip and /dev/null differ
diff --git a/Deployment/bin/NET45/DBreeze_1_095_2019_0812_NET45_MONO.zip b/Deployment/bin/NET45/DBreeze_1_095_2019_0812_NET45_MONO.zip
new file mode 100644
index 00000000..8afe0ff9
Binary files /dev/null and b/Deployment/bin/NET45/DBreeze_1_095_2019_0812_NET45_MONO.zip differ
diff --git a/Deployment/bin/NET461/DBreeze.dll b/Deployment/bin/NET461/DBreeze.dll
index f5fd02df..179415b6 100644
Binary files a/Deployment/bin/NET461/DBreeze.dll and b/Deployment/bin/NET461/DBreeze.dll differ
diff --git a/Deployment/bin/NET461/DBreeze_1_094_2019_0609_NET461.zip b/Deployment/bin/NET461/DBreeze_1_094_2019_0609_NET461.zip
deleted file mode 100644
index d4c0555b..00000000
Binary files a/Deployment/bin/NET461/DBreeze_1_094_2019_0609_NET461.zip and /dev/null differ
diff --git a/Deployment/bin/NET461/DBreeze_1_095_2019_0812_NET461.zip b/Deployment/bin/NET461/DBreeze_1_095_2019_0812_NET461.zip
new file mode 100644
index 00000000..74c0b243
Binary files /dev/null and b/Deployment/bin/NET461/DBreeze_1_095_2019_0812_NET461.zip differ
diff --git a/Deployment/bin/NET462/DBreeze.dll b/Deployment/bin/NET462/DBreeze.dll
index b0f2d8b3..cab26f22 100644
Binary files a/Deployment/bin/NET462/DBreeze.dll and b/Deployment/bin/NET462/DBreeze.dll differ
diff --git a/Deployment/bin/NET462/DBreeze_1_094_2019_0609_NET462.zip b/Deployment/bin/NET462/DBreeze_1_094_2019_0609_NET462.zip
deleted file mode 100644
index 50ce75bb..00000000
Binary files a/Deployment/bin/NET462/DBreeze_1_094_2019_0609_NET462.zip and /dev/null differ
diff --git a/Deployment/bin/NET462/DBreeze_1_095_2019_0812_NET462.zip b/Deployment/bin/NET462/DBreeze_1_095_2019_0812_NET462.zip
new file mode 100644
index 00000000..665885aa
Binary files /dev/null and b/Deployment/bin/NET462/DBreeze_1_095_2019_0812_NET462.zip differ
diff --git a/Deployment/bin/NET47/DBreeze.dll b/Deployment/bin/NET47/DBreeze.dll
index 54b27e94..51617b1f 100644
Binary files a/Deployment/bin/NET47/DBreeze.dll and b/Deployment/bin/NET47/DBreeze.dll differ
diff --git a/Deployment/bin/NET47/DBreeze_1_094_2019_0609_NET47.zip b/Deployment/bin/NET47/DBreeze_1_094_2019_0609_NET47.zip
deleted file mode 100644
index dca78fd2..00000000
Binary files a/Deployment/bin/NET47/DBreeze_1_094_2019_0609_NET47.zip and /dev/null differ
diff --git a/Deployment/bin/NET47/DBreeze_1_095_2019_0812_NET47.zip b/Deployment/bin/NET47/DBreeze_1_095_2019_0812_NET47.zip
new file mode 100644
index 00000000..b54e28a2
Binary files /dev/null and b/Deployment/bin/NET47/DBreeze_1_095_2019_0812_NET47.zip differ
diff --git a/Deployment/bin/NETCOREAPP1_0/DBreeze.dll b/Deployment/bin/NETCOREAPP1_0/DBreeze.dll
index 74517a51..e05c9df3 100644
Binary files a/Deployment/bin/NETCOREAPP1_0/DBreeze.dll and b/Deployment/bin/NETCOREAPP1_0/DBreeze.dll differ
diff --git a/Deployment/bin/NETCOREAPP1_0/DBreeze_1_094_2019_0609_NETCoreApp1_0.zip b/Deployment/bin/NETCOREAPP1_0/DBreeze_1_094_2019_0609_NETCoreApp1_0.zip
deleted file mode 100644
index b0859808..00000000
Binary files a/Deployment/bin/NETCOREAPP1_0/DBreeze_1_094_2019_0609_NETCoreApp1_0.zip and /dev/null differ
diff --git a/Deployment/bin/NETCOREAPP1_0/DBreeze_1_095_2019_0812_NETCoreApp1_0.zip b/Deployment/bin/NETCOREAPP1_0/DBreeze_1_095_2019_0812_NETCoreApp1_0.zip
new file mode 100644
index 00000000..4cf6d418
Binary files /dev/null and b/Deployment/bin/NETCOREAPP1_0/DBreeze_1_095_2019_0812_NETCoreApp1_0.zip differ
diff --git a/Deployment/bin/NETCOREAPP1_1/DBreeze.dll b/Deployment/bin/NETCOREAPP1_1/DBreeze.dll
index 78800bbb..b5910e70 100644
Binary files a/Deployment/bin/NETCOREAPP1_1/DBreeze.dll and b/Deployment/bin/NETCOREAPP1_1/DBreeze.dll differ
diff --git a/Deployment/bin/NETCOREAPP1_1/DBreeze_1_094_2019_0609_NETCoreApp1_1.zip b/Deployment/bin/NETCOREAPP1_1/DBreeze_1_094_2019_0609_NETCoreApp1_1.zip
deleted file mode 100644
index fcb64e4f..00000000
Binary files a/Deployment/bin/NETCOREAPP1_1/DBreeze_1_094_2019_0609_NETCoreApp1_1.zip and /dev/null differ
diff --git a/Deployment/bin/NETCOREAPP1_1/DBreeze_1_095_2019_0812_NETCoreApp1_1.zip b/Deployment/bin/NETCOREAPP1_1/DBreeze_1_095_2019_0812_NETCoreApp1_1.zip
new file mode 100644
index 00000000..ac3ecbdc
Binary files /dev/null and b/Deployment/bin/NETCOREAPP1_1/DBreeze_1_095_2019_0812_NETCoreApp1_1.zip differ
diff --git a/Deployment/bin/NETCOREAPP2_0/DBreeze.dll b/Deployment/bin/NETCOREAPP2_0/DBreeze.dll
index 78800bbb..b5910e70 100644
Binary files a/Deployment/bin/NETCOREAPP2_0/DBreeze.dll and b/Deployment/bin/NETCOREAPP2_0/DBreeze.dll differ
diff --git a/Deployment/bin/NETCOREAPP2_0/DBreeze_1_094_2019_0609_NETCoreApp2_0.zip b/Deployment/bin/NETCOREAPP2_0/DBreeze_1_094_2019_0609_NETCoreApp2_0.zip
deleted file mode 100644
index b6196cea..00000000
Binary files a/Deployment/bin/NETCOREAPP2_0/DBreeze_1_094_2019_0609_NETCoreApp2_0.zip and /dev/null differ
diff --git a/Deployment/bin/NETCOREAPP2_0/DBreeze_1_095_2019_0812_NETCoreApp2_0.zip b/Deployment/bin/NETCOREAPP2_0/DBreeze_1_095_2019_0812_NETCoreApp2_0.zip
new file mode 100644
index 00000000..51efb10c
Binary files /dev/null and b/Deployment/bin/NETCOREAPP2_0/DBreeze_1_095_2019_0812_NETCoreApp2_0.zip differ
diff --git a/Deployment/bin/NETSTANDARD16/DBreeze.dll b/Deployment/bin/NETSTANDARD16/DBreeze.dll
index 8fc141ab..86bfb4ee 100644
Binary files a/Deployment/bin/NETSTANDARD16/DBreeze.dll and b/Deployment/bin/NETSTANDARD16/DBreeze.dll differ
diff --git a/Deployment/bin/NETSTANDARD16/DBreeze_1_094_2019_0609_NETSTANDARD_1_6.zip b/Deployment/bin/NETSTANDARD16/DBreeze_1_094_2019_0609_NETSTANDARD_1_6.zip
deleted file mode 100644
index 6f1880bc..00000000
Binary files a/Deployment/bin/NETSTANDARD16/DBreeze_1_094_2019_0609_NETSTANDARD_1_6.zip and /dev/null differ
diff --git a/Deployment/bin/NETSTANDARD16/DBreeze_1_095_2019_0812_NETSTANDARD_1_6.zip b/Deployment/bin/NETSTANDARD16/DBreeze_1_095_2019_0812_NETSTANDARD_1_6.zip
new file mode 100644
index 00000000..08cce73b
Binary files /dev/null and b/Deployment/bin/NETSTANDARD16/DBreeze_1_095_2019_0812_NETSTANDARD_1_6.zip differ
diff --git a/Deployment/bin/NETSTANDARD2_0/DBreeze.dll b/Deployment/bin/NETSTANDARD2_0/DBreeze.dll
index cbabb278..bf2fb293 100644
Binary files a/Deployment/bin/NETSTANDARD2_0/DBreeze.dll and b/Deployment/bin/NETSTANDARD2_0/DBreeze.dll differ
diff --git a/Deployment/bin/NETSTANDARD2_0/DBreeze_1_094_2019_0609_NETSTANDARD_2_0.zip b/Deployment/bin/NETSTANDARD2_0/DBreeze_1_094_2019_0609_NETSTANDARD_2_0.zip
deleted file mode 100644
index 1db5f6fe..00000000
Binary files a/Deployment/bin/NETSTANDARD2_0/DBreeze_1_094_2019_0609_NETSTANDARD_2_0.zip and /dev/null differ
diff --git a/Deployment/bin/NETSTANDARD2_0/DBreeze_1_095_2019_0812_NETSTANDARD_2_0.zip b/Deployment/bin/NETSTANDARD2_0/DBreeze_1_095_2019_0812_NETSTANDARD_2_0.zip
new file mode 100644
index 00000000..a51a3ef7
Binary files /dev/null and b/Deployment/bin/NETSTANDARD2_0/DBreeze_1_095_2019_0812_NETSTANDARD_2_0.zip differ
diff --git a/Deployment/bin/PORTABLE/DBreeze.dll b/Deployment/bin/PORTABLE/DBreeze.dll
index d509bffc..bbfc6414 100644
Binary files a/Deployment/bin/PORTABLE/DBreeze.dll and b/Deployment/bin/PORTABLE/DBreeze.dll differ
diff --git a/Deployment/bin/PORTABLE/DBreeze_1_094_2019_0609_NETPortable.zip b/Deployment/bin/PORTABLE/DBreeze_1_094_2019_0609_NETPortable.zip
deleted file mode 100644
index c3aa3451..00000000
Binary files a/Deployment/bin/PORTABLE/DBreeze_1_094_2019_0609_NETPortable.zip and /dev/null differ
diff --git a/Deployment/bin/PORTABLE/DBreeze_1_095_2019_0812_NETPortable.zip b/Deployment/bin/PORTABLE/DBreeze_1_095_2019_0812_NETPortable.zip
new file mode 100644
index 00000000..83b67e01
Binary files /dev/null and b/Deployment/bin/PORTABLE/DBreeze_1_095_2019_0812_NETPortable.zip differ
diff --git a/Deployment/bin/UWP/DBreeze.dll b/Deployment/bin/UWP/DBreeze.dll
index 0863af00..a5a9f94b 100644
Binary files a/Deployment/bin/UWP/DBreeze.dll and b/Deployment/bin/UWP/DBreeze.dll differ
diff --git a/Deployment/bin/UWP/DBreeze_1_094_2019_0609_NET451_NETCore_WinUWP.zip b/Deployment/bin/UWP/DBreeze_1_094_2019_0609_NET451_NETCore_WinUWP.zip
index cd58970d..c9319700 100644
Binary files a/Deployment/bin/UWP/DBreeze_1_094_2019_0609_NET451_NETCore_WinUWP.zip and b/Deployment/bin/UWP/DBreeze_1_094_2019_0609_NET451_NETCore_WinUWP.zip differ
diff --git a/Deployment/bin/XAMARIN/DBreeze.dll b/Deployment/bin/XAMARIN/DBreeze.dll
index 261839a0..166e465c 100644
Binary files a/Deployment/bin/XAMARIN/DBreeze.dll and b/Deployment/bin/XAMARIN/DBreeze.dll differ
diff --git a/Deployment/bin/XAMARIN/DBreeze_1_094_2019_0609_Xamarin_Android_MONO.zip b/Deployment/bin/XAMARIN/DBreeze_1_094_2019_0609_Xamarin_Android_MONO.zip
deleted file mode 100644
index 36b035e9..00000000
Binary files a/Deployment/bin/XAMARIN/DBreeze_1_094_2019_0609_Xamarin_Android_MONO.zip and /dev/null differ
diff --git a/Deployment/bin/XAMARIN/DBreeze_1_095_2019_0812_Xamarin_Android_MONO.zip b/Deployment/bin/XAMARIN/DBreeze_1_095_2019_0812_Xamarin_Android_MONO.zip
new file mode 100644
index 00000000..3d6c753f
Binary files /dev/null and b/Deployment/bin/XAMARIN/DBreeze_1_095_2019_0812_Xamarin_Android_MONO.zip differ
diff --git a/NETPortable/DBreeze.Portable.csproj b/NETPortable/DBreeze.Portable.csproj
index 611e54f1..8c12b53a 100644
--- a/NETPortable/DBreeze.Portable.csproj
+++ b/NETPortable/DBreeze.Portable.csproj
@@ -22,7 +22,7 @@
full
false
bin\Debug\
- DEBUG;TRACE
+ TRACE;DEBUG;NETPORTABLE
prompt
4
diff --git a/NETPortable/Properties/AssemblyInfo.cs b/NETPortable/Properties/AssemblyInfo.cs
index 73ba2283..db168d69 100644
--- a/NETPortable/Properties/AssemblyInfo.cs
+++ b/NETPortable/Properties/AssemblyInfo.cs
@@ -26,6 +26,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.094.2019.0609")]
-[assembly: AssemblyFileVersion("1.094.2019.0609")]
+[assembly: AssemblyVersion("1.095.2019.0812")]
+[assembly: AssemblyFileVersion("1.095.2019.0812")]