circular/ring byte buffer implementation