Send API currently looks like:
void Send(byte[] data);
Since it eventually copies this buffer to the websocket message, it would be ideal if the API had an optional buffer size/length parameter, ie: something like:
void Send(byte[] data, int dataLen=0);
If 0 is passed in then data.Length is used.
Context
The code I used to read from the stream (ie: stream.ReadAsync) requires a buffer to be created first and returns the number of bytes read. In order to pass this buffer to Deepgram C# API, I need to copy it to another array that is sized as the number of bytes actually read, not the size of the passed in buffer. If the API had this option I could avoid a copy and it would be more efficient.
Proposed changes
Send API currently looks like: void Send(byte[] data);
Since it eventually copies this buffer to the websocket message, it would be ideal if the API had an optional buffer size/length parameter, ie: something like: void Send(byte[] data, int dataLen=0);
If 0 is passed in then data.Length is used.
Context
The code I used to read from the stream (ie: stream.ReadAsync) requires a buffer to be created first and returns the number of bytes read. In order to pass this buffer to Deepgram C# API, I need to copy it to another array that is sized as the number of bytes actually read, not the size of the passed in buffer. If the API had this option I could avoid a copy and it would be more efficient.