Skip to content

Is there are particular design reason why you can't Dequeue without Array Copy? #7

@pha3z

Description

@pha3z

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions