修补一些bug
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user