Use Stream extension to ensure read operations return the requested number of bytes (unless EOF arrives first).

This commit is contained in:
2022-11-14 09:43:16 +00:00
parent f90cc6593f
commit 0eb589d785
178 changed files with 862 additions and 780 deletions

View File

@@ -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();