mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Propagate errors through NxFileStream
This commit is contained in:
parent
9eb35528ac
commit
71fafcac85
1 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@ public class NxFileStream : Stream
|
||||||
|
|
||||||
public override int Read(byte[] buffer, int offset, int count)
|
public override int Read(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
BaseFile.Read(out long bytesRead, Position, buffer.AsSpan(offset, count));
|
BaseFile.Read(out long bytesRead, Position, buffer.AsSpan(offset, count)).ThrowIfFailure();
|
||||||
|
|
||||||
Position += bytesRead;
|
Position += bytesRead;
|
||||||
return (int)bytesRead;
|
return (int)bytesRead;
|
||||||
|
@ -33,14 +33,14 @@ public class NxFileStream : Stream
|
||||||
|
|
||||||
public override void Write(byte[] buffer, int offset, int count)
|
public override void Write(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
BaseFile.Write(Position, buffer.AsSpan(offset, count));
|
BaseFile.Write(Position, buffer.AsSpan(offset, count)).ThrowIfFailure();
|
||||||
|
|
||||||
Position += count;
|
Position += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Flush()
|
public override void Flush()
|
||||||
{
|
{
|
||||||
BaseFile.Flush();
|
BaseFile.Flush().ThrowIfFailure();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override long Seek(long offset, SeekOrigin origin)
|
public override long Seek(long offset, SeekOrigin origin)
|
||||||
|
|
Loading…
Reference in a new issue