Example #1
0
 /// <summary>Writes the specified array into the stream.</summary>
 /// <typeparam name="T">The type of the array item.</typeparam>
 /// <param name="items">The items.</param>
 public void Write <T>(T[] items)
 {
     if (items == null)
     {
         return;
     }
     if (items.GetType().GetElementType() == typeof(string))
     {
         using var hMem = SafeHGlobalHandle.CreateFromStringList(items as string[], StringListPackMethod.Packed, CharSet, 0);
         var bytes = hMem.ToArray <byte>(hMem.Size);
         Write(bytes, 0, bytes.Length);
     }
     else
     {
         Position += Pointer.Write(items, (int)Position, Capacity);
     }
 }