factored ioringbuf out into its own file