public override int Read(byte[] buffer, int offset, int count)
{
ValidateRead(buffer, offset, count);
int bytesRead;
int errCode = ReadFileNative(_handle, buffer, offset, count, _isPipe, out bytesRead, _useFileAPIs);
if (Interop.Errors.ERROR_SUCCESS != errCode)
throw Win32Marshal.GetExceptionForWin32Error(errCode);
return bytesRead;
}