[Modify] Polish it

This commit is contained in:
sta 2019-06-19 19:35:50 +09:00
parent 66be92d490
commit af6e4e534e

View File

@ -706,10 +706,11 @@ namespace WebSocketSharp
return buff;
}
internal static byte[] ReadBytes (this Stream stream, long length, int bufferLength)
internal static byte[] ReadBytes (
this Stream stream, long length, int bufferLength
)
{
using (var dest = new MemoryStream ()) {
try {
var buff = new byte[bufferLength];
var nread = 0;
while (length > 0) {
@ -723,9 +724,6 @@ namespace WebSocketSharp
dest.Write (buff, 0, nread);
length -= nread;
}
}
catch {
}
dest.Close ();
return dest.ToArray ();