2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00

UInt8Array fix

This commit is contained in:
2020-01-13 14:45:06 +03:00
parent f9bbd603ce
commit 5f4660fde2
8 changed files with 40 additions and 10 deletions

View File

@ -640,7 +640,7 @@ namespace Esyur.Data
public static sbyte[] GetInt8Array(this byte[] data, uint offset, uint length)
{
var rt = new sbyte[length];
Buffer.BlockCopy(rt, (int)offset, rt, 0, (int)length);
Buffer.BlockCopy(data, (int)offset, rt, 0, (int)length);
return rt;
}
@ -652,7 +652,7 @@ namespace Esyur.Data
public static byte[] GetUInt8Array(this byte[] data, uint offset, uint length)
{
var rt = new byte[length];
Buffer.BlockCopy(rt, (int)offset, rt, 0, (int)length);
Buffer.BlockCopy(data, (int)offset, rt, 0, (int)length);
return rt;
}

View File

@ -57,8 +57,8 @@ namespace Esyur.Data
//Array = 0x80,
VarArray = 0x80,
BoolArray,
UInt8Array,
Int8Array,
UInt8Array,
CharArray,
Int16Array,
UInt16Array,

View File

@ -36,7 +36,7 @@ using Esyur.Core;
namespace Esyur.Data
{
public class KeyList<KT, T> : IEnumerable
public class KeyList<KT, T> : IEnumerable<KeyValuePair<KT, T>>
{
private readonly object syncRoot = new object();
private Dictionary<KT, T> dic;
@ -144,11 +144,18 @@ namespace Esyur.Data
}
}
public IEnumerator GetEnumerator()
public IEnumerator<KeyValuePair<KT, T>> GetEnumerator()
{
return dic.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return dic.GetEnumerator();
}
public void Clear()
{
if (removableList)