diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs index a30617d9..db09af5d 100644 --- a/websocket-sharp/Server/WebSocketServiceManager.cs +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -722,11 +722,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 ("It is less than 1.", "length"); + if (length < 1) { + var msg = "Less than 1."; + throw new ArgumentException (msg, "length"); + } var bytes = stream.ReadBytes (length); @@ -739,7 +743,7 @@ namespace WebSocketSharp.Server if (len < length) { _log.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 ) );