You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dequeue always performs an array copy and returns the bytes.
If consumer Peeks at the data, consumer now has the byte array. Consumer can follow up with a dequeue to remove the bytes from the buffer, but consumer does not necessarily need the byte array returned because consumer already has it.
It seems desireable to be able to Peek at byte buffer, and then Dequeue it without performing a needless array copy.
To me it makes sense to add a VoidDequeue method that allows dequeuing without return. Is there a particular reason this is not implemented?
The text was updated successfully, but these errors were encountered:
I probably never needed such a method. It's been a while, but I guess I looked at .NET's Queue class and its methods when I created this API. So there's Dequeue and Peek. I don't know when I actually used such a Peek method myself. So there should be no reason not to add a void-dequeue operation.
Dequeue always performs an array copy and returns the bytes.
If consumer Peeks at the data, consumer now has the byte array. Consumer can follow up with a dequeue to remove the bytes from the buffer, but consumer does not necessarily need the byte array returned because consumer already has it.
It seems desireable to be able to Peek at byte buffer, and then Dequeue it without performing a needless array copy.
To me it makes sense to add a VoidDequeue method that allows dequeuing without return. Is there a particular reason this is not implemented?
The text was updated successfully, but these errors were encountered: