[Modify] Polish it
This commit is contained in:
parent
66be92d490
commit
af6e4e534e
@ -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 ();
|
||||
|
Loading…
Reference in New Issue
Block a user