Simple ring buffer class: handy for use with the Spark Core.