By | 2011-06-02

… is that the right name?

It basically works like a combination of the StringBuilder and Queue objects. You enqueue arrays of T, and you dequeue custom sized chunks of the array. What makes it nice is that I’ve optimized memory usage so it never creates any temp arrays internally except the one returned to you when you eat (of course).

Added some comments in case you need to change anything.

And the unit test if you want (doesn’t cover all scenarios):

Leave a Reply

Your email address will not be published. Required fields are marked *