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 #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; var left = _data.Length - _offset;
if (left == 0) if (left == 0)
return left; return left;
if (size > left) if (count > left)
size = left; count = left;
Buffer.BlockCopy (_data, _offset, buffer, offset, size); Buffer.BlockCopy (_data, _offset, buffer, offset, count);
_offset += size; _offset += count;
return size; return count;
} }
#endregion #endregion