修补一些bug

This commit is contained in:
2025-09-15 12:01:54 +08:00
parent 249836d1ec
commit f8aea1c383
18 changed files with 875 additions and 456 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
@@ -2144,5 +2145,21 @@ namespace Convention
return Activator.CreateInstance(type);
}
}
public static partial class ConventionUtility
{
public static byte[] ReadAllBytes(this BinaryReader reader)
{
const int bufferSize = 4096;
using (var ms = new MemoryStream())
{
byte[] buffer = new byte[bufferSize];
int count;
while ((count = reader.Read(buffer, 0, buffer.Length)) != 0)
ms.Write(buffer, 0, count);
return ms.ToArray();
}
}
}
}