[Modify] Polish it
This commit is contained in:
parent
168a335266
commit
fd9d5acbda
@ -532,11 +532,15 @@ namespace WebSocketSharp.Server
|
||||
if (stream == null)
|
||||
throw new ArgumentNullException ("stream");
|
||||
|
||||
if (!stream.CanRead)
|
||||
throw new ArgumentException ("It cannot be read.", "stream");
|
||||
if (!stream.CanRead) {
|
||||
var msg = "It cannot be read.";
|
||||
throw new ArgumentException (msg, "stream");
|
||||
}
|
||||
|
||||
if (length < 1)
|
||||
throw new ArgumentException ("Less than 1.", "length");
|
||||
if (length < 1) {
|
||||
var msg = "Less than 1.";
|
||||
throw new ArgumentException (msg, "length");
|
||||
}
|
||||
|
||||
var bytes = stream.ReadBytes (length);
|
||||
|
||||
@ -549,7 +553,7 @@ namespace WebSocketSharp.Server
|
||||
if (len < length) {
|
||||
_logger.Warn (
|
||||
String.Format (
|
||||
"Only {0} byte(s) of data could be read from the specified stream.",
|
||||
"Only {0} byte(s) of data could be read from the stream.",
|
||||
len
|
||||
)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user