mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use Stream extension to ensure read operations return the requested number of bytes (unless EOF arrives first).
This commit is contained in:
@@ -33,6 +33,7 @@ using Aaru.Checksums;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Filters;
|
||||
using Aaru.Helpers;
|
||||
using NUnit.Framework;
|
||||
|
||||
[TestFixture]
|
||||
@@ -58,7 +59,7 @@ public class AppleDoubleUnAr
|
||||
filter.Open(_location);
|
||||
Stream str = filter.GetDataForkStream();
|
||||
var data = new byte[737280];
|
||||
str.Read(data, 0, 737280);
|
||||
str.EnsureRead(data, 0, 737280);
|
||||
str.Close();
|
||||
str.Dispose();
|
||||
filter.Close();
|
||||
@@ -90,7 +91,7 @@ public class AppleDoubleUnAr
|
||||
filter.Open(_location);
|
||||
Stream str = filter.GetResourceForkStream();
|
||||
var data = new byte[286];
|
||||
str.Read(data, 0, 286);
|
||||
str.EnsureRead(data, 0, 286);
|
||||
str.Close();
|
||||
str.Dispose();
|
||||
filter.Close();
|
||||
|
||||
Reference in New Issue
Block a user