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

@@ -36,6 +36,7 @@ using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
public sealed partial class CopyTape
{
@@ -49,7 +50,7 @@ public sealed partial class CopyTape
Stream strm = imageFilter.GetDataForkStream();
strm.Position = 0;
strm.Read(header, 0, 16);
strm.EnsureRead(header, 0, 16);
string mark = Encoding.ASCII.GetString(header);