Refactored a few for Chunk.cs

This commit is contained in:
sta 2015-03-29 17:05:55 +09:00
parent 39bdc15f3f
commit 7857aa7076

View File

@ -71,19 +71,19 @@ namespace WebSocketSharp.Net
#region Public Methods
public int Read (byte [] buffer, int offset, int size)
public int Read (byte[] buffer, int offset, int count)
{
var left = _data.Length - _offset;
if (left == 0)
return left;
if (size > left)
size = left;
if (count > left)
count = left;
Buffer.BlockCopy (_data, _offset, buffer, offset, size);
_offset += size;
Buffer.BlockCopy (_data, _offset, buffer, offset, count);
_offset += count;
return size;
return count;
}
#endregion