Fixed passing byte[] into GetSize

pull/83/head
David Hall 2019-12-10 06:54:55 -07:00
parent 89d17b5241
commit c3121e6ecb
1 changed files with 4 additions and 1 deletions

View File

@ -407,7 +407,7 @@ namespace Vanara.InteropServices
if (value is IntPtr p)
Marshal.WriteIntPtr(PositionPtr, p);
else
PositionPtr.Write(value);
stSize = InteropExtensions.WriteNoChecks(PositionPtr, value, 0, Capacity - Position);
position += stSize;
length += stSize;
}
@ -477,6 +477,9 @@ namespace Vanara.InteropServices
case IntPtr p:
return IntPtr.Size;
case IEnumerable<byte> b:
return b.Count();
case IEnumerable<string> es:
return es.Sum(s => s.GetByteCount(true, charSet));