Change buffer from an Array to a Queue.

* Queue allows blocking on empty.