[Modify] Polish it
This commit is contained in:
parent
f1741f912b
commit
da0ae5dfd3
@ -120,17 +120,26 @@ namespace WebSocketSharp.Net
|
|||||||
byte[] buffer, int offset, int count, AsyncCallback callback, object state
|
byte[] buffer, int offset, int count, AsyncCallback callback, object state
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (_disposed)
|
if (_disposed) {
|
||||||
throw new ObjectDisposedException (GetType ().ToString ());
|
var name = GetType ().ToString ();
|
||||||
|
|
||||||
|
throw new ObjectDisposedException (name);
|
||||||
|
}
|
||||||
|
|
||||||
if (buffer == null)
|
if (buffer == null)
|
||||||
throw new ArgumentNullException ("buffer");
|
throw new ArgumentNullException ("buffer");
|
||||||
|
|
||||||
if (offset < 0)
|
if (offset < 0) {
|
||||||
throw new ArgumentOutOfRangeException ("offset", "A negative value.");
|
var msg = "A negative value.";
|
||||||
|
|
||||||
if (count < 0)
|
throw new ArgumentOutOfRangeException ("offset", msg);
|
||||||
throw new ArgumentOutOfRangeException ("count", "A negative value.");
|
}
|
||||||
|
|
||||||
|
if (count < 0) {
|
||||||
|
var msg = "A negative value.";
|
||||||
|
|
||||||
|
throw new ArgumentOutOfRangeException ("count", msg);
|
||||||
|
}
|
||||||
|
|
||||||
var len = buffer.Length;
|
var len = buffer.Length;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user