[Modify] Polish it
This commit is contained in:
parent
0ffec334bb
commit
f6c5c70cd9
@ -74,13 +74,15 @@ namespace WebSocketSharp.Net
|
|||||||
public int Read (byte[] buffer, int offset, int count)
|
public int Read (byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
var left = _data.Length - _offset;
|
var left = _data.Length - _offset;
|
||||||
|
|
||||||
if (left == 0)
|
if (left == 0)
|
||||||
return left;
|
return 0;
|
||||||
|
|
||||||
if (count > left)
|
if (count > left)
|
||||||
count = left;
|
count = left;
|
||||||
|
|
||||||
Buffer.BlockCopy (_data, _offset, buffer, offset, count);
|
Buffer.BlockCopy (_data, _offset, buffer, offset, count);
|
||||||
|
|
||||||
_offset += count;
|
_offset += count;
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
Reference in New Issue
Block a user