public override void Write(byte[] buffer, int offset, int count)
{
ValidateWrite(buffer, offset, count);
int errCode = WriteFileNative(_handle, buffer, offset, count, _useFileAPIs);
if (Interop.Errors.ERROR_SUCCESS != errCode)
throw Win32Marshal.GetExceptionForWin32Error(errCode);
}