Implement and assert on ring buffer stream.

Closes #4.