diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index c4e803ed6..f549e8683 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -2692,6 +2692,33 @@ public void Send (byte[] data) send (Opcode.Binary, new MemoryStream (data)); } + + /// + /// Sends binary using the WebSocket connection. + /// + /// + /// An array of that represents the binary data to send. + /// + /// + /// Start index for reading array . + /// + /// + /// Number of elements in array to send. + /// + public void Send (byte[] data, int index, int count) + { + var msg = _readyState.CheckIfAvailable (false, true, false, false) ?? + CheckSendParameter (data); + + if (msg != null) { + _logger.Error (msg); + error ("An error has occurred in sending data.", null); + + return; + } + + send (Opcode.Binary, new MemoryStream (data, index, count)); + } /// /// Sends the specified as binary data using the WebSocket connection.