|
|
|
|
@ -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 ();
|
|
|
|
|
|