[Modify] Polish it

This commit is contained in:
sta 2017-08-16 15:25:29 +09:00
parent ef777f69e1
commit b754c4b6ab

View File

@ -712,11 +712,15 @@ namespace WebSocketSharp.Server
if (stream == null) if (stream == null)
throw new ArgumentNullException ("stream"); throw new ArgumentNullException ("stream");
if (!stream.CanRead) if (!stream.CanRead) {
throw new ArgumentException ("It cannot be read.", "stream"); var msg = "It cannot be read.";
throw new ArgumentException (msg, "stream");
}
if (length < 1) if (length < 1) {
throw new ArgumentException ("Less than 1.", "length"); var msg = "Less than 1.";
throw new ArgumentException (msg, "length");
}
var bytes = stream.ReadBytes (length); var bytes = stream.ReadBytes (length);
@ -729,7 +733,7 @@ namespace WebSocketSharp.Server
if (len < length) { if (len < length) {
_logger.Warn ( _logger.Warn (
String.Format ( 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 len
) )
); );