[Modify] Polish it

This commit is contained in:
sta 2019-06-27 20:08:30 +09:00
parent 49a090413b
commit e5fefd3abf

View File

@ -319,10 +319,14 @@ namespace WebSocketSharp
) )
{ {
var buff = new byte[bufferLength]; var buff = new byte[bufferLength];
var nread = source.Read (buff, 0, bufferLength); var nread = 0;
while (nread > 0) {
destination.Write (buff, 0, nread); while (true) {
nread = source.Read (buff, 0, bufferLength); nread = source.Read (buff, 0, bufferLength);
if (nread <= 0)
break;
destination.Write (buff, 0, nread);
} }
} }