in csharp/NativeUtils/FileStream.cs [431:454]
public void Write(byte[] buffer, int offset, int count)
{
if (null == buffer)
throw new ArgumentException();
int length = buffer.Length;
if ((offset | count) < 0 || offset + count < 0 || offset + count > length)
throw new ArgumentException();
if (_fd <= 0)
throw new ObjectDisposedException("FileStream");
long written = -1;
unsafe
{
fixed (byte* ptr = buffer)
{
written = write(_fd, new IntPtr(ptr + (uint)offset), (uint)count);
}
}
if (written != count)
ThrowLastError("write");
}