Removed throwing the exception in from Ext.EqualsWith method
This commit is contained in:
parent
e7bb146394
commit
477ef2277e
@ -424,7 +424,7 @@ namespace WebSocketSharp
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the specified <see cref="int"/> equals the specified <see cref="char"/>,
|
/// Determines whether the specified <see cref="int"/> equals the specified <see cref="char"/>,
|
||||||
/// and invokes the specified Action<int> delegate at the same time.
|
/// and invokes the specified <c>Action<int></c> delegate at the same time.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// <c>true</c> if <paramref name="value"/> equals <paramref name="c"/>;
|
/// <c>true</c> if <paramref name="value"/> equals <paramref name="c"/>;
|
||||||
@ -437,18 +437,12 @@ namespace WebSocketSharp
|
|||||||
/// A <see cref="char"/> to compare.
|
/// A <see cref="char"/> to compare.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="action">
|
/// <param name="action">
|
||||||
/// An Action<int> delegate that references the method(s) called at
|
/// An <c>Action<int></c> delegate that references the method(s) called
|
||||||
/// the same time as comparing. An <see cref="int"/> parameter to pass to
|
/// at the same time as comparing. An <see cref="int"/> parameter to pass to
|
||||||
/// the method(s) is <paramref name="value"/>.
|
/// the method(s) is <paramref name="value"/>.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <exception cref="ArgumentOutOfRangeException">
|
|
||||||
/// <paramref name="value"/> isn't between 0 and 255.
|
|
||||||
/// </exception>
|
|
||||||
internal static bool EqualsWith (this int value, char c, Action<int> action)
|
internal static bool EqualsWith (this int value, char c, Action<int> action)
|
||||||
{
|
{
|
||||||
if (value < 0 || value > 255)
|
|
||||||
throw new ArgumentOutOfRangeException ("value");
|
|
||||||
|
|
||||||
action (value);
|
action (value);
|
||||||
return value == c - 0;
|
return value == c - 0;
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,9 @@ namespace WebSocketSharp
|
|||||||
var buff = new List<byte> ();
|
var buff = new List<byte> ();
|
||||||
var cnt = 0;
|
var cnt = 0;
|
||||||
Action<int> add = i => {
|
Action<int> add = i => {
|
||||||
|
if (i == -1)
|
||||||
|
throw new EndOfStreamException ("The header cannot be read from the data source.");
|
||||||
|
|
||||||
buff.Add ((byte) i);
|
buff.Add ((byte) i);
|
||||||
cnt++;
|
cnt++;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user