|
|
|
@ -54,17 +54,13 @@ public static class BitUtls
|
|
|
|
|
|
|
|
|
|
if (propertyType == STRING)
|
|
|
|
|
{
|
|
|
|
|
return Convert.ChangeType(Encoding.ASCII.GetString(bytes, start, length/8), propertyType);
|
|
|
|
|
byte[] sub = Sub(bytes, start, length);
|
|
|
|
|
return Convert.ChangeType(Encoding.ASCII.GetString(sub), propertyType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (propertyType == BYTEARRAY)
|
|
|
|
|
{
|
|
|
|
|
length = length / 8;
|
|
|
|
|
var bt = new byte[length];
|
|
|
|
|
start = start / 8;
|
|
|
|
|
for (var i = start; i < start + length; i++) bt[i - start] = bytes[i];
|
|
|
|
|
|
|
|
|
|
return bt;
|
|
|
|
|
return Sub(bytes, start, length);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw new ArgumentException($"参数类型{propertyType}不支持encode!");
|
|
|
|
|