Fix exception creation

This commit is contained in:
YoshiRulz 2020-06-21 06:15:19 +10:00 committed by zeromus
parent abcf91f7d6
commit 0e1271c7c2
1 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ namespace BizHawk.Emulation.Common
public override int Read(byte[] buffer, int offset, int count)
{
if (offset < 0 || offset + count > buffer.Length)
throw new ArgumentOutOfRangeException("offset");
throw new ArgumentException("start or end not within bounds of buffer", nameof(offset));
count = (int)Math.Min(count, Length - Position);
if (count == 0)
return 0;
@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Common
public override void Write(byte[] buffer, int offset, int count)
{
if (offset < 0 || offset + count > buffer.Length)
throw new ArgumentOutOfRangeException("offset");
throw new ArgumentException("start or end not within bounds of buffer", nameof(offset));
for (var i = offset; i < offset + count; i++)
_d.PokeByte(Position++, buffer[i]);
}